comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Type convertion
Date: Thu, 13 Mar 2008 01:33:46 -0700 (PDT)
Date: 2008-03-13T01:33:46-07:00	[thread overview]
Message-ID: <22a25d83-4516-4f66-85b6-0382f2c951f5@b64g2000hsa.googlegroups.com> (raw)
In-Reply-To: 87r6efsmc7.fsf@ludovic-brenta.org

On 12 Mar, 21:45, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:

> Yes.  My C is getting rustier by the day but I seem to remember that
> the language standard does require enums to have the same size as int.

No. The underlying type for enum has to be big enough to fit all
defined values. It can be equivalent to int even for small sets, but
does not have to be - in other words, it does not have to be bigger
than necessary.

And it can be larger that int for enums that don't fit in int.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com



  reply	other threads:[~2008-03-13  8:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 16:10 Type convertion news.broadpark.no
2008-03-11 16:59 ` Ed Falis
2008-03-11 20:45   ` Ludovic Brenta
2008-03-12 20:36     ` Simon Wright
2008-03-12 20:45       ` Ludovic Brenta
2008-03-13  8:33         ` Maciej Sobczak [this message]
2008-03-24  2:14           ` David Thompson
2008-03-11 17:39 ` Jeffrey R. Carter
2008-03-11 20:53   ` news.broadpark.no
2008-03-11 21:40     ` Ludovic Brenta
2008-03-11 17:49 ` Stuart
2008-03-11 20:56   ` news.broadpark.no
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox