nmh-workers
[Top] [All Lists]

[Nmh-workers] Compiler warnings and signed vs. unsigned char, again

2013-02-04 10:57:53
With Lyndon's work on the buildbot (thanks, again!) he has brought up
a number of good points about how we decide what warnings to supress
when compiling.  But that leads me to think maybe we should actually fix
the code in question to get rid of the warnings.

I did a bit of that; I saw a bunch of warnings from buildbot about
possible variable clobbering, and some investigation made me realize
that it was because we used vfork() in a lot of places.  We've actually
discussed this on the mailing list a bunch of times, and every time it
came up there was widespread agreement that we should simply get rid of
vfork(), but it never got done.  Okay, so I did that; a bunch of warnings
are now gone!  There are still some clobber warnings from uses of setjmp();
those require some more investigation.

But that brings me to one of the bigger pile of warnings; signed char versus
unsigned char.  Lyndon asked (two years ago) if anyone knew about the
history of this.  It turns out mh-6.8.5 very rarely used unsigned char,
so that's a nmh addition.  I tracked down the major source of those
warnings to this commit:

commit 13f84dd50ca5754391dbd3296a5c7425f9363600
Author: Joel Reicher <jjr(_at_)panacea(_dot_)null(_dot_)org>
Date:   Fri Apr 13 11:53:08 2007 +0000

    Change all chars being passed to the ctype macros (isalph(), etc.) to
    be unsigned chars, following through to change any other types as
    necessary (e.g. comparison between two pointers). Not all chars have
    been changed to unsigned chars; just those that were in danger of being
    sign extended when passed to the int-taking ctype macros.

The discussion about this change was here:

    http://lists.nongnu.org/archive/html/nmh-workers/2007-04/msg00033.html

Okay, seems clear enough.  But I'm wondering what the "right" solution
is here.  Should we simply convert things like the format engine over
to use unsigned char for everything?  Considering that we're starting
to support 8-bit characters more and more, that seems like the best
solution.  But what do others think?

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>
  • [Nmh-workers] Compiler warnings and signed vs. unsigned char, again, Ken Hornstein <=