https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91046

--- Comment #2 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
It warns with -pedantic, but not without. This is an issue if this is not
guaranteed to "work" with GCC (now or in the future). Indeed, the case of an
empty translation unit may need additional code. For instance, in
gcc/dwarf2out.c, there is a comment:

  /* Even if there are no children of this DIE, we must output the information
     about the compilation unit.  Otherwise, on an empty translation unit, we
     will generate a present, but empty, .debug_info section.  IRIX 6.5 `nm'
     will then complain when examining the file.  First mark all the DIEs in
     this CU so we know which get local refs.  */

Thus empty translation units seem to be supported there, but it is not obvious
that this is the case everywhere. A warning by default would make the user
aware of that.

Reply via email to