Cast the log10 argument to double to disambiguate it
authorChristian Biesinger <cbiesinger@google.com>
Wed, 18 Dec 2019 23:50:33 +0000 (17:50 -0600)
committerChristian Biesinger <cbiesinger@google.com>
Thu, 19 Dec 2019 19:11:29 +0000 (13:11 -0600)
On Solaris 11 with gcc 5.5.0 (gcc211 on the compile farm), math.h has a
using std::log10; directive. This is unfortunate because std::log10 has
overloads for float/double/long double. To disambiguate this call,
cast the argument to double to fix the build.

gdb/ChangeLog:

2019-12-19  Christian Biesinger  <cbiesinger@google.com>

* tui/tui-source.c (tui_source_window::set_contents): Cast argument of
log10 to double to fix Solaris 11 with gcc 5.5.

Change-Id: I6c0c52e9c172b529c899a435d430e5916aeef69f

gdb/ChangeLog
gdb/tui/tui-source.c

index e0da79eda815c77c67e9afca7492d3e8bbae76c0..8595b6eafcea98628b6dc3a94fec103e2fb865de 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-19  Christian Biesinger  <cbiesinger@google.com>
+
+       * tui/tui-source.c (tui_source_window::set_contents): Cast argument of
+       log10 to double to fix Solaris 11 with gcc 5.5.
+
 2019-12-19  Christian Biesinger  <cbiesinger@google.com>
 
        * fbsd-tdep.c (fbsd_info_proc_files_entry): Rename local var
index 32877d7bc87a009205b7a880bf54bd2e9ea7ac98..6c3425fb895ae2a27c579c19868d80c2a4ac0e11 100644 (file)
@@ -85,7 +85,9 @@ tui_source_window::set_contents (struct gdbarch *arch,
          int digits = 0;
          if (compact_source)
            {
-             double l = log10 (offsets->size ());
+             /* Solaris 11+gcc 5.5 has ambiguous overloads of log10, so we
+                cast to double to get the right one.  */
+             double l = log10 ((double) offsets->size ());
              digits = 1 + (int) l;
            }
 
This page took 0.033158 seconds and 4 git commands to generate.