[Bug c/91046] New: missing warning about empty translation unit
vincent-gcc at vinc17 dot net
gcc-bugzilla@gcc.gnu.org
Mon Jul 1 13:01:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91046
Bug ID: 91046
Summary: missing warning about empty translation unit
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: vincent-gcc at vinc17 dot net
Target Milestone: ---
The C standard forbids empty translation units, and if the program is compiled
successfully (as what GCC does by default), the behavior of this program is
undefined (currently, even with GCC, as the behavior is not specified by its
manual). Thus GCC should issue a warning, even without -pedantic.
Alternatively, GCC could explicitly define the behavior as an extension (if
this is currently the case) and document it in its manual, in which case the
warning could be issued only with -pedantic as now. It should be sufficient to
say that empty translation units are allowed, since the text of the C standard
would not need additional specifications to make the behavior unambiguous.
More information about the Gcc-bugs
mailing list