constant signed/unsigned comparison warning

Chip Salzenberg chip@rio.atlantic.net
Wed Sep 24 13:25:00 GMT 1997


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



More information about the Gcc mailing list