Specifying the underlying enum type in g++

Jean-Claude Gervais jc.gervais@videotron.ca
Sat Sep 26 09:51:00 GMT 2009


gcc-4.4.1 (g++) does support specifying the underlying type of an 'enum
type'
Thank you

On Thu, 2009-09-24 at 17:26 -0400, Jean-Claude Gervais wrote:
> Thank you for the answers, Axel, Gabriel.
> 
> Installing a newer version of g++ is a possibility, since this is
> research I am doing for a possible future port.
> 
> The distro I am running has a few versions of gcc in its catalog, the
> question is, which version of gcc supports the extension?
> 
> These are the versions of gcc I could potentially install to test it.
> 
> gcc-4.4.1
> gcc-4.3.4
> gcc-4.3.3-r2
> gcc-4.3.2-r4
> gcc-4.3.2-r3
> 
> I will try installing gcc-4.4.1 first to see.
> Thanks for your help.
> J
> 
> On Thu, 2009-09-24 at 15:41 -0500, Gabriel Dos Reis wrote:
> > On Thu, Sep 24, 2009 at 10:11 AM, Jean-Claude Gervais
> > <jc.gervais@videotron.ca> wrote:
> > > Hello,
> > >
> > > I am using gcc 4.1.2 and 4.3.2, looking for a way to specify the
> > > underlying type in a typedef enum declaration like so:
> > >
> > > typedef enum : unsigned char { first_tag, second_tag, third_tag }
> > > my_enum_type;
> > 
> > There is a C++0x extension to do that, but you would have to get
> > newer versions of g++.
> > 
> > >
> > > The preceding statement compiles with visualc++ but not with g++
> > >
> > > Is there a way?
> > >
> > > Thanks
> > > J
> > >
> > >
> 



More information about the Gcc-help mailing list