[fpc-pascal] C Enum vs. Integer

Vinzent Höfler JeLlyFish.software at gmx.net
Wed Sep 12 21:22:36 CEST 2012


On Wed, 12 Sep 2012 20:44:21 +0200, Jonas Maebe  
<jonas.maebe at elis.ugent.be> wrote:

> Include an appropriate {$packenum xxx} directive in your source code.  
> There is no {$packenum c} (I'm not even sure whether the C standard says  
> anything about the size of enums),

Yes, it does say something about it:

|Each enumerated type shall be compatible with char, a signed integer type,
|or an unsigned integer type. The choice of type is implementation-defined
|but shall be capable of representing the values of all the members of the
|enumeration.
   --  ISO/IEC 9899:1999, 6.7.2.2 (4)

It says it's implementation defined. :D


Vinzent.

-- 
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
     -- Nathaniel Borenstein



More information about the fpc-pascal mailing list