LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2010, 02:49 AM   #1
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
warning: no newline at end of file - really starting to get on my nerves


How the hell do i get rid of it?
 
Old 02-08-2010, 03:06 AM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
I guess this is a warning from gcc? Be sure that any headers file are ending by an empty line, this is due assure source compatibility if you want to compile your sources with some very old C compiler that doesn't handle header files inclusion properly when they does not end by an empty newline...
 
1 members found this post helpful.
Old 02-08-2010, 03:09 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,288

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
There's a standard thing you'll find. Going back to typewriter days, the m$dos system and successors did a carriage_return/line_feed. Linux just puts the return at the end of a line. There are utilities to swap around it. BTW, if you find yourself here, just be aware that this problem was licked in the 70s or early 80s and the solutions are many utilities that convert msods files to linux ones. You can even write a file and add carriage returns with sed or awk

If you have no return at all, and you want one, I think it's done off the terminal width. In vim, you can do this with
:set tw=80
or any chosen figure. My knowledge of vim, emacs, etc is also squat
 
1 members found this post helpful.
Old 02-08-2010, 12:45 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
It seems completely stupid but i try to fix it.
 
Old 02-09-2010, 06:23 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,288

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
These are the joys of 'reinventing the wheel'. If you have a clear vision how your system is going to differ, start a project. If not, forget it, as what you write now will be out of date by the time you have much assembled.
 
Old 02-09-2010, 06:50 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Or using your favorite text editor move the cursor to the end of the last line, past the last character and press the enter key. gcc expects an end of line character on every line but it sees an end of file marker.

Last edited by michaelk; 02-09-2010 at 06:59 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra newline at end of file? sayeo87 Linux - Software 7 09-17-2010 04:45 AM
warning: no final newline at the end of /etc/fstab Jeebizz Slackware 2 10-12-2004 02:19 PM
warning: no newline at end of file huno Programming 1 07-16-2004 09:39 AM
[mntent]:warning: no final newline at the end of /etc/fstab Rodcl Linux - Hardware 4 08-25-2002 02:58 PM
Warning: no newline at end of file acid_kewpie Programming 1 03-13-2002 02:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration