https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81745
--- Comment #14 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> --- (In reply to Andrew Pinski from comment #13) > GCC removed the pedwarning on purpose (between GCC 4.1 and 4.4), see PR > 14331 and PR 68994. No, PR 14331 was just asking to remove the warning by default, not that `-pedantic` shouldn't warn: "I checked through the gcc manual, and didn't found any option to suppress the warning message "no newline at end of file". And PR 68994 was complaining about the missing warning. > https://gcc.gnu.org/legacy-ml/gcc-patches/2007-04/msg00651.html > is the specific one about GCC's behavior and since it is considered > undefined at compile time (not a runtime one) GCC behavior is correct so is > clang Even though GCC decides to add a newline to the logical file, so that the missing diagnostic can be regarded as correct, I think that an optional warning would be useful for portability. https://gcc.gnu.org/legacy-ml/gcc-patches/2007-04/msg00651.html was suggesting "add -W(no-)eof-newline". So why hasn't -Wno-eof-newline been added?