This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Cast the log10 argument to double to disambiguate it


On Thu, Dec 19, 2019 at 12:17 PM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>
> >> Date: Wed, 18 Dec 2019 18:01:02 -0600
> >> From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
> >> Cc: Christian Biesinger <cbiesinger@google.com>
> >>
> >> 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.
>
> Eli> We may wish to have a comment in the code referring to the original
> Eli> problem, including perhaps the OS and the compiler versions?
> Eli> Otherwise the need for this cast is not immediately obvious, IMO.
>
> Agreed; this is ok with that change.

OK, will push with this comment:
      /* Solaris 11+gcc 5.5 has ambiguous overloads of log10, so we
         cast to double to get the right one.  */

Christian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]