https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81745
Vincent Lefèvre <vincent-gcc at vinc17 dot net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #4 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> --- (In reply to Andrew Pinski from comment #3) > https://gcc.gnu.org/ml/gcc-patches/2007-04/msg00504.html > > See that reasoning there. "It's really not undefined at all. gcc would be still be standard conformant if we defined all input to end with a newline, whether or not the actual physical Unix input file did so." OK, but this needs to be documented. The GCC manual says: ------------------------------------------------------------------------ 4.2 Environment =============== The behavior of most of these points are dependent on the implementation of the C library, and are not defined by GCC itself. * 'The mapping between physical source file multibyte characters and the source character set in translation phase 1 (C90, C99 and C11 5.1.1.2).' ------------------------------------------------------------------------ However, the fact that all input files are regarded to end with a newline is completely specific to GCC, not part of how the C library works.