nmh-workers
[Top][All Lists]
Advanced

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

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


From: David Levine
Subject: Re: [Nmh-workers] Compiler warnings and signed vs. unsigned char, again
Date: Tue, 05 Feb 2013 15:27:14 -0500

> >I prefer the first because 1) we deal with chars that we,
> >within nmh, always interpret as unsigned,
> 
> Do we?  I was looking at that and _in my brief
> examination_ I saw that we mostly don't do math on them,
> except in a few ASCII-specific cases.  But I could believe
> I missed it.

I meant in the sense that the bytes in an email message are
interpreted as unsigned.  Whether we actually do or not is a
good question :-]

> >Though seeing the arguments, I'm OK with the second
> >approach.  Especially if we get the compilers to flag
> >missing casts.
> 
> I think we're going to have to do some work on that front;
> I don't see how to make that happen out of the box on some
> systems.

If it turns out that we can't detect it, we should prevent
it.  Macros might be ugly but are better than relying on
programmer discipline.

To detect it, we could incorporate Tom's approach, say, into
debug builds.  (That brings up another question, assert(),
but for another day.)  Or add a configure option to enable
it.

> I did find some of those in the format compiler, check out
> "struct ftable" in fmt_compile.  AFAICT that was just done
> to save space; there's no reason I can tell that we need
> that.

Yup.  It doesn't look like there are values >127 in there
now, but we're getting close (90).

David



reply via email to

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