[FYI] Include <cmath> in dwarf-index-write.c

Message ID 20180327145657.27534-1-tom@tromey.com
State New
Headers show
Series
  • [FYI] Include <cmath> in dwarf-index-write.c
Related show

Commit Message

Tom Tromey March 27, 2018, 2:56 p.m.
On x86-64 Fedora 26, when building with the system gcc, I get:

../../binutils-gdb/gdb/dwarf-index-write.c: In member function ‘void debug_names::build()’:
../../binutils-gdb/gdb/dwarf-index-write.c:705:13: error: ‘pow’ is not a member of ‘std’

There are actually more messages, but this is sufficient to show the
problem.

The fix is to include <cmath>.

I'm checking this in as obvious.  Tested by building.

gdb/ChangeLog
2018-03-27  Tom Tromey  <tom@tromey.com>

	* dwarf-index-write.c: Include <cmath>.
---
 gdb/ChangeLog           | 4 ++++
 gdb/dwarf-index-write.c | 1 +
 2 files changed, 5 insertions(+)

-- 
2.13.6

Comments

Simon Marchi March 27, 2018, 3:06 p.m. | #1
On 2018-03-27 10:56, Tom Tromey wrote:
> On x86-64 Fedora 26, when building with the system gcc, I get:

> 

> ../../binutils-gdb/gdb/dwarf-index-write.c: In member function ‘void

> debug_names::build()’:

> ../../binutils-gdb/gdb/dwarf-index-write.c:705:13: error: ‘pow’ is not

> a member of ‘std’

> 

> There are actually more messages, but this is sufficient to show the

> problem.

> 

> The fix is to include <cmath>.

> 

> I'm checking this in as obvious.  Tested by building.

> 

> gdb/ChangeLog

> 2018-03-27  Tom Tromey  <tom@tromey.com>

> 

> 	* dwarf-index-write.c: Include <cmath>.

> ---

>  gdb/ChangeLog           | 4 ++++

>  gdb/dwarf-index-write.c | 1 +

>  2 files changed, 5 insertions(+)

> 

> diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c

> index 3059e0b776..058712d9e2 100644

> --- a/gdb/dwarf-index-write.c

> +++ b/gdb/dwarf-index-write.c

> @@ -34,6 +34,7 @@

>  #include "psympriv.h"

> 

>  #include <algorithm>

> +#include <cmath>

>  #include <set>

>  #include <unordered_map>

>  #include <unordered_set>


Oops, thanks!

Patch

diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c
index 3059e0b776..058712d9e2 100644
--- a/gdb/dwarf-index-write.c
+++ b/gdb/dwarf-index-write.c
@@ -34,6 +34,7 @@ 
 #include "psympriv.h"
 
 #include <algorithm>
+#include <cmath>
 #include <set>
 #include <unordered_map>
 #include <unordered_set>