This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/61319] The tests c-c++-common/ubsan/float-cast-overflow-(1|2|4).c fail on x86_64-apple-darwin*
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 May 2014 09:23:39 +0000
- Subject: [Bug target/61319] The tests c-c++-common/ubsan/float-cast-overflow-(1|2|4).c fail on x86_64-apple-darwin*
- Auto-submitted: auto-generated
- References: <bug-61319-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61319
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|testsuite |target
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
No they are supposed to generate -nan. If it does not then there is a bug
somewhere else.
Really you should report this to Apple since it is a bug in their snprintf
implementation.
Here is the code:
// FIXME: Support floating-point formatting in sanitizer_common's
// printf, and stop using snprintf here.
char Buffer[32];
snprintf(Buffer, sizeof(Buffer), "%Lg", (long double)A.Float);
Printf("%s", Buffer);