| | |
no newline at end of file error
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2004
Posts: 56
Reputation:
Solved Threads: 2
Hey everyone,
This is my first time here just to let ya know. Hopefully you can help me.
The language is C++. I am currently working on a file that consists of functions to manipulate doubly linked lists from the main program. After writing several function everything was fine. Then I wrote one function that called a function farther done in the file. This shouldn't give any problems but it did this time. So I cut and pastes the first function so it was after the function it called. This fixed one problem but started a new one. The error was:
80:2 warning: no newline at end of file
The 80 is the always the last line of the file. So if I write more the number changes to 98, 104, 130........ I can't get rid of this error. Even if I delete the functions that "caused" this error. Any idea what I need to do to fix this.
This is my first time here just to let ya know. Hopefully you can help me.
The language is C++. I am currently working on a file that consists of functions to manipulate doubly linked lists from the main program. After writing several function everything was fine. Then I wrote one function that called a function farther done in the file. This shouldn't give any problems but it did this time. So I cut and pastes the first function so it was after the function it called. This fixed one problem but started a new one. The error was:
80:2 warning: no newline at end of file
The 80 is the always the last line of the file. So if I write more the number changes to 98, 104, 130........ I can't get rid of this error. Even if I delete the functions that "caused" this error. Any idea what I need to do to fix this.
Go to the last line of the file, to the last character in the line, and hit return/enter.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
yea, also you can press Ctrl-End (which take you to the end of the page) and press enter (to make a blank line )
Simple
Simple
for i in *.c; do echo >> $i; done How is that going to take you any time at all to do?
Here I'm assuming that since you're using gcc, that you also have a decent shell to play with as well.
Of course, you could refine it to say
-
grep all the lines with that error message-
awk those lines to extract the filenames- apply the first line to the list of filenames
Like I said, use 'grep' to find all those error message lines which mention the "no newline" part, then isolate the corresponding filename.
Even passable familiarity with grep / sed / awk / perl and the shell will significantly improve your experience. I suggest you post some example lines, and your attempts at using these tools in the shell scripting forum if you want to continue this further.
Even passable familiarity with grep / sed / awk / perl and the shell will significantly improve your experience. I suggest you post some example lines, and your attempts at using these tools in the shell scripting forum if you want to continue this further.
![]() |
Similar Threads
- warning:no newline at end of file (C)
- 'Input Past End of File' Error Persists even with 'EOF' Statements (Visual Basic 4 / 5 / 6)
- ERROR--Unexpected end to file (C++)
Other Threads in the C++ Forum
- Previous Thread: file writing speed (API)
- Next Thread: Semafore in Windows problem
| Thread Tools | Search this Thread |
api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib library linkedlist linker list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting string strings studio temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






