Bug 32161
Summary: | g++ fails to detect when int main() does not have a return statement | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Wagner T. Correa <wtcorrea> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.0 | CC: | wtcorrea |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-03-18 22:36:47 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Wagner T. Correa
2001-03-18 22:36:22 UTC
No, this is correct. ISO C++ [basic.start.main]/5 sais that: If control reached the end of main without encountering a return statement, the effect is that of executing return 0; For functions other than main, the standard requires non-void functions to end with return statement. |