Connecting Tech Pros Worldwide Help | Site Map

Re: reporting typedef errors automatically

Roman Mashak
Guest
 
Posts: n/a
#1: Jun 27 '08
Hello, Jens!
You wrote on 29 May 2008 20:54:28 GMT:

[skip]
JTTI guess it's meant to provoke the compiler to emit an error
JTTmessage (or at least a warning) in the case that int8_ta and
JTTuint8_t don't have a size of 1, int8_t/uint8_t don't have a
JTTsize of 2 etc. since in that case e.g. 'sizeof( int8_t ) == 1'
JTTwoukd be false and thus result in the value 0. And then you
JTTwould try to create an array of length 0 which isn't legal.

I integrated the above code in the test example and compiled it twice with
'gcc -W -Wall -std=c99...' and 'gcc -W -Wall -std=c89...'. No error was
emmited in the second case. Should it have been?

JTTI don't know if this is a good idea, I guess I would instead
JTTuse something that tests if CHAR_BITS is 8 since that seems
JTTto be what all that boils down to.

With best regards, Roman Mashak. E-mail: mrv@tusur.ru


Closed Thread