summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-09-12 21:23:37 -0400
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-09-12 21:23:37 -0400
commitec6c8338a89b0ec022b66ed3efdd1577e6449d6d (patch)
tree2b8882cd19e7a67f755f4fbbda9d0a7c33d6e0e5
parent5fabdcd6801a4567db9c88ceb112ca222544b13f (diff)
downloadbinutils-gdb-ec6c8338a89b0ec022b66ed3efdd1577e6449d6d.tar.gz
gdb: Force use of float version of log10
This commit: commit aa17805fb9a3a1983a510ba425b682fba03410c2 Date: Sat Aug 31 23:44:40 2019 +0100 gdb: Have 'maint info sections' print all sections again introduced a use of log10 that took an int as a parameter. Unfortunately this was causing a compilation error on Solaris, see: https://sourceware.org/ml/gdb-patches/2019-09/msg00230.html https://sourceware.org/ml/gdb-patches/2019-09/msg00231.html because there was only a float, double, or long double version of log10, and the compiler doesn't know which to choose. This commit should resolve this issue by casting the argument to float. gdb/ChangeLog: * maint.c (maint_print_section_data::maint_print_section_data): Force use of 'float log10 (float)' by casting the argument to float.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/maint.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4158161393e..147882447e2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2019-09-12 Andrew Burgess <andrew.burgess@embecosm.com>
+ * maint.c (maint_print_section_data::maint_print_section_data):
+ Force use of 'float log10 (float)' by casting the argument to
+ float.
+
+2019-09-12 Andrew Burgess <andrew.burgess@embecosm.com>
+
* maint.c: Add 'cmath' include.
(struct maint_print_section_data): New structure.
(print_section_index): New function.
diff --git a/gdb/maint.c b/gdb/maint.c
index 286ec310135..1a621a17191 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -301,7 +301,7 @@ struct maint_print_section_data
arg(arg)
{
int section_count = gdb_bfd_count_sections (abfd);
- index_digits = ((int) log10 (section_count)) + 1;
+ index_digits = ((int) log10 ((float) section_count)) + 1;
}
private: