This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] PR libstdc++/13045 / C++ demangler, floating values and function pointer type return type postfix fix.


Geert Bosch <bosch@gnat.com> writes:

> On Nov 24, 2003, at 16:30, Ian Lance Taylor wrote:
> > It's perhaps worth noting that the libiberty demangler currently
> > follows a much simpler approach than the C++ demangler, which is to
> > not attempt to interpret floating constants at all.  This is fully
> > compliant with non-IEEE targets, and produces demanglings like
> >     void f<1>(A<(1) + (((int)(-((float)3f800000))))>)
> 
> Doesn't (float) 0x3f800000 produce the floating point number
> 1065353216.0
> (which has memory representation 0x4e7e0000) instead of 1.0 as you
> expect?

No doubt.

The whole point of this discussion is that the demangler does not know
the format of floating point literals in mangled names.  The mangled
name in this case contains the literal string "3f800000".  The
demangler does not know how to interpret that, so it simply reports
the literal string.

Ian


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