GCC Compiler warnings with GnuPG 1.4.1

Werner Koch wk at gnupg.org
Mon Apr 11 20:23:10 CEST 2005


On Thu, 7 Apr 2005 19:23:59 +0200, Christian Biere said:

> The first and the last do not look completely harmless (i.e., could
> cause a crash) at a glance. The others are just "noise" and we

Right.  I fixed them by adding an isascii() check.  Also changed the
other pales to use isascii() instead of testing the high bit directly.

> a bad idea to keep this noise around. (Do you use GCC with the
> above options at all?)

No, because gcc seems not smart enough to detect the possible range of
values.

> This way you don't loose any compiler warnings an evil cast would
> hide.

alternativley I could use the simple digitp, hexdigitp and spacep
macros I use at several other places.

Further, I think that NetBSD should change their ctype.h
implementation to provide values for negative offsets, like glibc
does.  The use of the isfoo macros is that widespreaded and I bet most
of the hackers living in 7 bit countries are still not aware of the
problems.  I have fixed literally thousands of such bugs in my life
but people are still getting it wrong (me too of course).  Given that
GNU/Linux doesn't care about it, they won't even notice it wehn
porting software. Sure, it should be done right from the beginning but
a safe fallback would be very appreciated.


Shalom-Salam,

   Werner




More information about the Gnupg-devel mailing list