[Prev][Next][Index]

Re: Problems with enums



> Hi,
> 

> I realize that this is not a Sage bug. Our restructuring
> tool works with ansi C and we are having problems with
> enums. If the user has the following declaration:
> 

> typedef enum { a=1, b } myEnum;
> 

> It is unparsed to:
> 

> enum { a=1, b } myEnum;
> 

> That is, the 'typedef' keyword is dropped and that
> confuses the ansi C compiler.
> 


This was a sage bug. It has been fixed. I just tried to unparse your  
example and I got the following with the latest version of sage:

typedef  enum  {
 a = 1, b
}myEnum;

I just need to do some searching to find out how I fixed this bug (it  
was a while ago). I'll send you a patch as soon as I figure this out.
               --Beata