Skip to content

Missing '-Wreturn-type' warning for 'main' having no return statement in C89 mode #21650

Closed
@morinmorin

Description

@morinmorin
Bugzilla Link 21276
Version unspecified
OS All

Extended Description

Clang does not emit "control reaches end of non-void function [-Wreturn-type]" warning for 'main' having no return statement in C89 mode (-std=c89, gnu89).

Clang adds implicit-return-zero in C89 mode. But, since the C89 standard does not require it, wouldn't it be better to emit warning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillacclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyfalse-negativegood first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions