[Prev][Next][Index]

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. We also tried to do:

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

But it didn't work either. Is there a way to patch the unparser to keep
the 'typedef' keyword when unparsing enums? Thank you.

Diego.


-- 
Diego Novillo (diego@cs.ualberta.ca)    |      Dept of Computing Science
WWW http://web.cs.ualberta.ca/~diego    |          University of Alberta
Use 'finger' to get my PGP public key   |     Edmonton, Alberta - Canada