Skip to content

Allow forward definition of enums #23

Closed
@ian-ross

Description

@ian-ross

Bug imported from C2HS Trac

Trac ticket created: 2009-09-22T12:35:40-0700


foo.h:

extern enum hello hello_fn(int);
$ c2hs foo.h foo.chs
c2hs: C header contains errors:

foo.h:1: (column 8) [ERROR]  >>> error
  Forward definition of enumeration!
  ANSI C does not permit foreward definitions of enumerations!

Strictly speaking this is true, in -pedantic mode gcc reports:

foo.h:1: warning: ISO C forbids forward references to �enum� types

However it's clearly not a very serious issue since the warning is only included in -pedantic and is accepted without warning even in -std=c99 -Wall mode. In particular this feature is used in the Linux kernel sometimes.

So the task is to work out what such forward uses mean and to adjust the C2HS.C.Trav module as appropriate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions