This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: constant signed/unsigned comparison warning
- To: bothner at cygnus dot com (Per Bothner)
- Subject: Re: constant signed/unsigned comparison warning
- From: Chip Salzenberg <chip at rio dot atlantic dot net>
- Date: Wed, 24 Sep 1997 16:24:35 -0400 (EDT)
- Cc: egcs at cygnus dot com, gcc2 at cygnus dot com
- Reply-To: chip at pobox dot com
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