CoCoC icon indicating copy to clipboard operation
CoCoC copied to clipboard

CC09: unsigned number literals

Open Deek opened this issue 4 years ago • 0 comments

CC09 barfs on explicitly unsigned numbers. If you assign to an unsigned variable a hex-notated value with the highest order bit set, or a negative number, the code will indeed treat it as unsigned as far as I know, but there's no way for a raw number's signedness to be denoted. C89+ use a U notation, just like the L notation for a "long" number.

We may be able to get away with just eating the U to enable interoperability, but think I'd rather make explicitly unsigned numbers get tagged as UCHAR, UINT, UCONST, ULCONST instead of CHAR, INT, CONST, LCONST.

Something to look into later, when everything else works, or when someone wants to look at it. :)

Deek avatar May 09 '20 20:05 Deek