-
March 16th, 2007, 04:09 AM
#1
carriage return / line feed
I've just joined a project that will be built for both Windows & Linux. At the moment, its source files use 'line feed' (0x0A) to indicate end-of-line. Unfortunately, if I do any editing in VC++, it does the old DOS/Windows trick of adding a carriage return, giving 0x0D, 0x0A. This seems to upset the Linux build.
VC++ seems happy enough to read files without carriage returns - but is there a way to stop it from writing carriage returns? Alternatively, is there an alternative IDE which doesn't have that problem?
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
March 16th, 2007, 04:48 AM
#2
Re: carriage return / line feed
Hi John,
Not sure I understand your problem 100%. Is your problem that every line has an 'M' appended to it when you do a linux compile?
If so, you can use the dos2unix command to translate between ASCII CR+LF (DOS/Windows) and LF (Unix) newlines.
Alternatively, you may have a look at this freeware editor: PSPAD A freeware code editor
Not sure this is your problem tough!
Regards,
Laitinen
Last edited by laitinen; March 16th, 2007 at 04:54 AM.
-
March 16th, 2007, 05:25 AM
#3
Re: carriage return / line feed
Hi Laitinen. Yes that's approximately it. Re-reading my post, I didn't explain it too well. Basically, what happens is that the original line feeds remain as line feeds - but any new lines that I introduce are saved with CR/LF pairs. Therefore in the finished file, some EOL's are LF only and some are CR/LF. I'll try your suggestions though.
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
March 16th, 2007, 03:21 PM
#4
Re: carriage return / line feed
Interesting. I've been doing cross platform development for a few years now, and I've never seen this behavior (I've been using Visual Studio 6 and up).
Viggy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|