Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Newline at EOF
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mstormo
Starting Member

1 Posts

Posted - May 31 2006 :  09:27:34 AM  Show Profile  Reply with Quote
It would be nice if Visual Assist X would have an option to ensure that source files end with a newline. As the sourcecode I write is used cross-platform, I sometimes forget to add this newline at the end of a source file, the code on other platforms using gcc will complain with a compile warning:
warning: no newline at end of file

When the "Add newline at end of file" is turned on, VAX could simply check when a file is saved, and add it if necessary.

--
.marius

feline
Whole Tomato Software

United Kingdom
19003 Posts

Posted - May 31 2006 :  3:21:36 PM  Show Profile  Reply with Quote
i know exactly what you mean, quite a bit of my code has to compile under UNIX. for me adding the blank like has become something of a habit

i was sure we already had an outstanding request for this but i cannot find it, so i have put in a new one.

case=1225

zen is the art of being at one with the two'ness
Go to Top of Page

efortier
Ketchup Master

Canada
89 Posts

Posted - Jun 01 2006 :  8:58:50 PM  Show Profile  Reply with Quote
I'm also using a compiler that complains about this. I don't understand the reason for the warning, but I got into the habit of always running a macro to add a newline whenever I open a new source file.

Thanks for adding a request for this.

VS2005 Pro/Team Suite English
http://www.tlnewsreader.com

Edited by - efortier on Jun 01 2006 8:59:14 PM
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Jun 02 2006 :  12:07:50 AM  Show Profile  Reply with Quote
The reason for it is that the standard says that if a non-empty source file does not end in a new line character, the behavior is undefined.

Part of the reason for this is the multitude of problems that might occur if one file ends in the middle of some construct (although this is only partially mitigated by the end-of-line rule).

Joe Pizzi
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000