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]

 



And that undefined behavior is in the form of that warning you've
posted.  This simply lets you know what behavior the gcc developers
inserted.

You need the newline in order to have c++ standards behavior assumed
instead of gcc behavior -- it's a portability issue really.

corey

On 7/6/05, Jonathan Turkanis <technews@xxxxxxxxxxxxxxxxx> wrote:
> Neo Anderson wrote:
> > I don't even think it's a problem. Why do I need (or better have) a line
> > ending?
> 
> The C++ standard says: If a source file that is not empty does not end in a
> newline character, or ends in a newline character immediately preceded by a
> backslash character, the behavior is undefined. (2.1/1)
> 
> Jonathan
> 
>


[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