|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Anyone can told me about the warrning which GCC generated as following:
"No newline at end of file"? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On May 7, 7:47pm, friendfish <friendf...@gmail.com> wrote:
> Anyone can told me about the warrning which GCC generated as following: > "No newline at end of file"? By convention, in a Unix "text" file, all lines are terminated by the newline character. Most Unix text editors respect this convention. gcc is warning you that the file is not conforming to the convention, which means the last line might have been truncated and therefore you should look into that as it is a potential problem. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
fnegroni wrote:
> On May 7, 7:47�pm, friendfish <friendf...@gmail.com> wrote: > > Anyone can told me about the warrning which GCC generated as > > following: "No newline at end of file"? > > By convention, in a Unix "text" file, all lines are terminated by the > newline character. > Most Unix text editors respect this convention. > gcc is warning you that the file is not conforming to the convention, > which means the last line might have been truncated and therefore > you should look into that as it is a potential problem. <http://groups.google.com/group/comp.lang.c/search? group=comp.lang.c&q=No+newline+at+end+of+file> -- Peter |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Thu, 08 May 2008 10:47:57 +0800, friendfish <friendfish@gmail.com>
wrote in comp.lang.c: > Anyone can told me about the warrning which GCC generated as following: > "No newline at end of file"? The C standard states that "a source file that is non-empty shall end in a new-line character" and your source file doesn't. So add one. Open the source file in a text editor. Move the cursor to the end of the last line, after the last character. Press the "Enter" key on your keyboard. Save the file. -- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://c-faq.com/ comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
friendfish wrote:
> > Anyone can told me about the warrning which GCC generated as following: > "No newline at end of file"? It means that there is "No newline at end of file". What's the problem? Is it so hard to add it? -- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. ** Posted from http://www.teranews.com ** |
|
![]() |
| Outils de la discussion | |
|
|