This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: compiling empty files fails


Michael Meissner <meissner@cygnus.com> writes:

> I remember it being in the 1989 C standard that each translation
> unit must have at least one token.  I couldn't find it via a quick
> scan of the 1999 draft I have stored locally.

C99 mentions in 5.1.1.2 item 3.

  [...] A source file that is not empty shall end...

This could be read as "empty source files are valid".

But even without this argumentation, this was the previous behavior
and it is useful.  If you create input files you can conditionally
create them with some input or empty.  The compiler will in any case
do the right thing.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]