Is that the right fix?

Eric S. Raymond esr at thyrsus.com
Sun Mar 12 01:21:01 UTC 2017


Hal Murray <hmurray at megapathdsl.net>:
> 
> -               for (i = 1; i <= CC_MAXCODE; i++)
> +           for (i = 1; i <= (int)CC_MAXCODE; i++)
> 
> It looks ugly to me.
> 
> Why is CC_MAXCODE unsigned?
> ...
> #define CC_DEVICE       12
> #define CC_VARLIST      13U
> #define CC_MAXCODE      CC_VARLIST
> 
> 
> Removing the U works for me.

That is correct, yes.

I've seen people declare constants unsigned as a way of implying that the
associated implied range type can never have negative values. I don't
do this myself, but that might be why the U is there.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

Please consider contributing to my Patreon page at https://www.patreon.com/esr
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.



More information about the devel mailing list