This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix PR 45038, bad interaction between __DBL_MIN__ and -Wold-style-cast
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Nathan Froyd <froydnj at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 10 Nov 2010 09:46:34 -0600
- Subject: Re: [PATCH] fix PR 45038, bad interaction between __DBL_MIN__ and -Wold-style-cast
- References: <20101109221019.GI7991@nightcrawler> <20101110132218.GK7991@nightcrawler>
On Wed, Nov 10, 2010 at 7:22 AM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> On Tue, Nov 09, 2010 at 05:10:20PM -0500, Nathan Froyd wrote:
>> Builtin double-precision floating-point constants defined by the
>> preprocessor get defined as `((double)VAL)'; this style causes problems
>> with -Wold-style-cast. ?The patch below tweaks the definition of such
>> constants to use static_cast when compiling for C++.
>
> My previous patch was overly complicated. ?This one is much simpler.
> I used a function style cast as suggested by Gabriel, but I am unsure of
> whether that is preferred over static_cast.
It certainly is simpler -- and does not qualify as `old-style cast' which
is what you write in C.
The patch is OK with me. If you don't hear objects in the next 24 hours,
I would suggest to commit.
-- Gaby