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

Re: [csmith-dev] int8_t usage



Returning to a conversation from some weeks ago....

On 09/09/2011 12:45 AM, Arthur O'Dwyer wrote:
On Thu, Sep 8, 2011 at 10:49 AM, John Regehr<regehr@cs.utah.edu>  wrote:
That would be 16 bit. :) I know, it's a pretty wierd arch!

Is this a conforming C implementation?  I thought it was required that int
is larger than char.

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 §5.2.4.2.1 of n1256.pdf.

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

John