Skip to content

Clang accepts typed enums language extension with -std=c99 #57836

Open
@strimo378

Description

@strimo378

Hi all,

typed enums are not supported by C99 and any later C standard. It is supported by clang as a language extension of C.

See https://godbolt.org/z/4W1dMc53e as an example.

In my opinion, clang should only support typed enums in C if compiling with e.g. -std=gnu99 and not with -std=c99.

Furthermore, the documentation at https://clang.llvm.org/docs/LanguageExtensions.html#introduction is lacking information that typed enums are supported by clang in C. It is only noted that typed enums are supported for ObjectC.

Btw. GCC is not supporting typed enums in C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions