-Wimplicit-signed-char

Jamie Lokier jamie.lokier@cern.ch
Tue Apr 25 12:52:00 GMT 2000


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


More information about the Gcc mailing list