This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: error: "no newline at end of file"


* Ian Lance Taylor:

> I don't think we necessarily have to change anything.

Yes, I think that the standard does not require a particular approach
to this problem.

> But I think that Florian's point is that we don't have to confuse the
> concrete implementation with the abstract source representation.  We
> could define gcc such that when it sees a concrete file which does not
> end in ASCII 0x0a, it automatically appends ASCII 0x0a in the abstract
> representation.

Exactly.  During the first translation phase, end-of-line indicators
are converted to new-line characters.  If the majority of compilers
treats end-of-file as an end-of-line indicator (which wouldn't
surprise me), GCC can and should follow the crowd.


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