Re: Style question: comparison between signed and unsigned?

Craig Milo Rogers (rogers@ISI.EDU)
Tue, 23 Sep 1997 14:23:49 -0700


>I'll repeat my original suggestion: #pragma's that tell GCC that a
>particular function returns a type for which the signed/unsigned
>warnings shouldn't be emitted. Otherwise, you do have a real mess
>trying to figure out what's what.
>
>Another suggestion might be programming GNU emacs to have a
>M-x skip-meanless-flaming-worthless-gcc-warning-messages function.
>The point is that one way or another, we need to suppress the false
>positives, so that programmers can focus on the real warnings. The
>whole point of programming tools is to make life easier for the
>programmer, not harder.

Personally, and this is just my opinion, I prefer using an
explicit cast to suppress the warning message (no matter how much it
affronts the Higher Gods). No new #pragma is required. The cast can
be added once, when the warning message is first encountered, so
there's no need to wade through the same warning message
meaninglessly.

As for the question, "What if the programmer wants to change
the type of a variable?", I respond: all existing uses of such a
variable should be reviewed first, before making the change, and any
casts reviewed in particular.

Craig Milo Rogers