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] fix PR 45038, bad interaction between __DBL_MIN__ and -Wold-style-cast


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


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