This is the mail archive of the gcc@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: gcc trunk vs python


Paolo Bonzini wrote:
Jack Howarth wrote:
+       if (y == -1 && x < 0 && ((unsigned)x) == -(unsigned)x)
                return DIVMOD_OVERFLOW;

or just a much clearer


    if (y == -1 && x == INT_MIN)
        return DIVMOD_OVERFLOW;

(possibly with a #include <limits.h> at the top).
Nit picking -
"x" is of type long, so the fix should be either x==LONG_MIN or
(unsigned long)x == -(unsigned long)x.

This is completely off-topic on this list. I am sending this to the list
only to avoid having buggy code on the gcc-ml archives.

Michael


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