nmh-workers
[Top] [All Lists]

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

2013-02-05 14:27:34
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

_______________________________________________
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>