> Now, the PROBLEM is that if gcc warns about signed/unsigned comparisons
> (which some versions of gcc do), gcc will totally needlessly (and in my
> opinion incorrectly) warn about the second test (ie "i < sizeof(struct
> pkthdr)"). Because "i" is signed, but "sizeof" is unsigned.
I know this is where the warning is generated. But my claim is that this
supposedly "bad" code is forced due to the lame prototype for read().
Overloaded return values are bad.
You could misinterpret the compiler's warning to mean you need a cast ...
but really it means you need to redesign your code :)
Now that'll never happen for things like read(). So it makes this warning
absolutely useless in its current incarnation.