This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10296] QoI: ctype macros should trigger gcc -Wall warnings on 'char' argument
- From: "drepper at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 9 Jul 2010 22:33:55 -0000
- Subject: [Bug libc/10296] QoI: ctype macros should trigger gcc -Wall warnings on 'char' argument
- References: <20090618122655.10296.ebb9@byu.net>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From drepper at redhat dot com 2010-07-09 22:33 -------
Looking more at this, I won't change anything.
First of all, nothing what you describe is what current gcc versions for Linux
do. You do get warnings:
foo.c:8: warning: overflow in implicit constant conversion
foo.c:9: warning: overflow in implicit constant conversion
Second, with this "improvement" perfectly correct code will get warnings.
Almost all the code out there uses char* for strings and with the change all
situations where a character of a string is passed to an is* or to* function
will provoke a warning.
This is perfectly valid code. The is* and to* interfaces are not required to be
macros and they take int parameters. Just like in all similar situations the
parameters of type char are propagated to int before being used. And this is
what the code does. A bit more efficient than other solutions but the effect is
the same.
I won't make this "QoI change" (which it really isn't) because the positives are
by far outweighed by the negative, the countless of programs with correct code
which would provoke warnings. And all this not because the code would be
executed incorrectly. No, only because there are other lousy implementations
this might be a problem. No way.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
http://sourceware.org/bugzilla/show_bug.cgi?id=10296
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.