This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wimplicit-signed-char
- To: Russell King <rmk at arm dot linux dot org dot uk>
- Subject: Re: -Wimplicit-signed-char
- From: Jamie Lokier <jamie dot lokier at cern dot ch>
- Date: Tue, 25 Apr 2000 21:50:02 +0200
- Cc: gcc at gcc dot gnu dot org, philb at gnu dot org
- References: <200004242320.AAA08131@raistlin.arm.linux.org.uk>
Russell King wrote:
> char ch;
> do {
> ch = getopt(...);
> ...
> } while (ch != EOF);
>
> The above fragments of code compile cleanly on architectures which default
> to signed chars.
However, the EOF fragment is broken whatever the signedness :-)
Use `int ch'.
have a nice day,
-- Jamie