[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-dev] int8_t usage

On 28/09/11 06:41, John Regehr wrote:
Returning to a conversation from some weeks ago....

On 09/09/2011 12:45 AM, Arthur O'Dwyer wrote:

FYI, nope, it's only required that int be *at least as large* as
signed char. I remember this from my comp.lang.c days. ;) This can
cause huge problems with code that reads binary files, since you can
no longer distinguish EOF from a valid 'char' value, but hey, that's
why feof() exists.

In C99, INT_MAX cannot be less than 32767.

I get this from § of n1256.pdf.

Perhaps it is ANSI C that permits int to be as small as a char?

You're absolutely right.
I know your reply was for Arthur but just to note once again that this fact doesn't influence the fact that a 16bit char, 16 bit int arch without an int8_t (generated by CSmith) is C99 compliant.

I still think int8_t should be either removed or replaced by int_least8_t.

Paulo Matos

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog