Bug 45038 - __DBL_MIN__ result in old-style-cast
Summary: __DBL_MIN__ result in old-style-cast
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-23 03:09 UTC by Wang Cheng
Modified: 2010-11-15 15:26 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wang Cheng 2010-07-23 03:09:54 UTC
My code use DBL_MIN with warning option "-Wold-style-cast -Werror". 
But I found DBL_MIN definition has changed in gcc4.5.0
When use "./cpp -dM /dev/null", I got :
#define __DBL_MIN__ ((double)2.22507385850720138309e-308L)

Why gcc use old style cast in macro?
Comment 1 Andrew Pinski 2010-07-23 03:14:27 UTC
+  /* Cast the double precision constants.  This is needed when single
+     precision constants are specified or when pragma FLOAT_CONST_DECIMAL64
+     is used.  The correct result is computed by the compiler when using
+     macros that include a cast.  */
Comment 2 Nathan Froyd 2010-11-15 15:24:38 UTC
Author: froydnj
Date: Mon Nov 15 15:24:31 2010
New Revision: 166756

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166756
Log:
gcc/c-family/
	PR preprocessor/45038
	* c-cppbuiltin.c (c_cpp_builtins): Use different format for C++
	dialects.

gcc/testsuite/
	PR preprocessor/45038
	* g++.dg/pr45038.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/pr45038.C
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-cppbuiltin.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Nathan Froyd 2010-11-15 15:26:35 UTC
Fixed on trunk.