Re: What is the purpose of 'warning: no newline at end of file'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Neo,

>#include "Foo.h"

>There is already a newline after it. What does the Standard say?

The standard says that if you do not put in a newline at the end of Foo.h, the behavior is undefined.

The preprocessor directive #include "Foo.h" *includes* the newline at end-of-line.

No preprocessor that I know of puts in EXTRA newlines when it expands the preprocessor directives.  Putting in an EXTRA newline when the included file lacks one at the end-of-file is compiler specific (enhancement to standard) behavior.

Sincerely,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux