a silly question - newline warning

a silly question - newline warning

Post by chiva » Thu, 21 Mar 2002 22:57:55



hi there,
i guess this ones is really silly.
what is this warning : "no newline at the end of file" while compiling a c file.
is it a serious one?

thank you.

 
 
 

a silly question - newline warning

Post by Nils O. Sel?sd » Thu, 21 Mar 2002 23:19:00



Quote:>hi there,
>i guess this ones is really silly.
>what is this warning : "no newline at the end of file" while compiling a c file.

It means the last line of code in the file does not have a newline after it.
Quote:>is it a serious one?

No, but certain old compilers(which you'll never use anyway)  might be confused.

 
 
 

a silly question - newline warning

Post by Barry Margoli » Fri, 22 Mar 2002 01:29:29





>>hi there,
>>i guess this ones is really silly.
>>what is this warning : "no newline at the end of file" while compiling a c file.
>It means the last line of code in the file does not have a newline after it.
>>is it a serious one?
>No, but certain old compilers(which you'll never use anyway)  might be confused.

Also, some other Unix tools, which you might use, may be confused.  Many
Unix applications expect all lines in a text file to end in newline, and if
the last line doesn't they'll ignore it.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

a silly question - newline warning

Post by Ed L Cashi » Fri, 22 Mar 2002 03:00:54






> >>hi there,
> >>i guess this ones is really silly.
> >>what is this warning : "no newline at the end of file" while compiling a c file.
> >It means the last line of code in the file does not have a newline after it.
> >>is it a serious one?
> >No, but certain old compilers(which you'll never use anyway)  might be confused.

> Also, some other Unix tools, which you might use, may be confused.  Many
> Unix applications expect all lines in a text file to end in newline, and if
> the last line doesn't they'll ignore it.

If you're using emacs, you can put this in your .emacs file:

  (setq require-final-newline t)

... to make sure that the last line is always complete (with regard to
the convention that a newline character marks the end of a line).

--
--Ed L Cashin            |   PGP public key: