LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21276 - Missing '-Wreturn-type' warning for 'main' having no return statement in C89 mode
Summary: Missing '-Wreturn-type' warning for 'main' having no return statement in C89 ...
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: unspecified
Hardware: PC All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-14 11:24 PDT by Michel Morin
Modified: 2014-10-14 11:24 PDT (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Morin 2014-10-14 11:24:28 PDT
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?