[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing warnings in FIXNUM_OVERFLOW_P

From: Eli Zaretskii
Subject: Re: Preventing warnings in FIXNUM_OVERFLOW_P
Date: Fri, 19 Jan 2007 13:50:00 +0200

> From: Richard Stallman <address@hidden>
> Date: Fri, 19 Jan 2007 05:42:53 -0500
> Cc: address@hidden
>     Eli's current workaround is still the least bad I've seen.
> A GCC developer says that the warning does not happen for unsigned
> types.  That means that even if GCC gets smarter, it won't give that
> warning if we use an unsigned type.

But this modification of the macro causes it to look suspicious, as it
compares an unsigned variable with a signed (and negative) number.  I
don't think it's a good idea to modify our code to the point that an
experienced C programmer (such as me and you) can no longer be sure
that the code is correct.

By contrast, my workaround doesn't obfuscate the code, and the
extra assignment should be optimized out of existence under -O2.

I say let's leave my workaround alone until the GCC developers move
this warning into -Wextra.  When that version of GCC becomes
widespread, we can remove the workaround.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]