GCC char* bug

Bruce Korb bkorb@pacbell.net
Sat Jul 21 10:22:00 GMT 2001


Carlo Wood wrote:

> As fputc takes an int as well, it makes more sense to ...

I believe that it makes most sense overall to find every
way possible to eliminate stumbling blocks to writing
functional code.  In this example, I already fixed my code
to cope with the issues at hand.  The remaining issue is,
what does one do in the future when deciding about things.
The answer I suggest is, choose a way that is easier to
not trip.  Signed chars are a pain in the derrier, especially
since getc() returns an unsigned char as an int and you
have to load its result into a signed int.  It hasn't been
a problem in the past because all chars were 0x08 thru 0x7E,
as everyone knows. :-)  So, my bug lay dormant for years.
Ouch.



More information about the Gcc-bugs mailing list