[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Ken Hornstein
Subject: [Nmh-workers] Compiler warnings and signed vs. unsigned char, again
Date: Mon, 04 Feb 2013 11:57:41 -0500

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 <address@hidden>
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:


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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]