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]

Re: constant signed/unsigned comparison warning


According to Per Bothner:
> > But that's not correct.  If you're writing INT_MAX + 1 bytes, then the
> > return value is INT_MIN, and that's an indication of success.
> 
> If you are writing INT_MAX + 1, then it is not going to fit in ssize_t
> or int ...

But the parameter of write() is not ssize_t, it's size_t.  The weasel
words in POSIX.1 are intended for ones-complement machines and other
normality-deficient environments.

> ... and I doubt the code would work in any case.

But don't we want gcc to support the efforts of people who are trying
to get it right?
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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