LinuxQuestions.org
Visit Jeremy's Blog.
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 08-28-2006, 12:41 PM   #1
gdmellott
LQ Newbie
 
Registered: Jan 2006
Location: Paonia, Colorado USA
Distribution: Red Hat, Debian, trying others.
Posts: 17

Rep: Reputation: 0
gcc program output configuration


Hi,
While trying to learn some C programming and using an old book called 'Linux Programming in 24 Hours'; I came across an odd behavior I could not figure out. I eventually came to the conclusion that the gcc compiler [which I was running on a old DOS machine to get RHIDE to work] was making the program convert CRLF characters on input to just LF and converting the LF to CRLF on output. Since the purpose of the program was to convert from and DOS to UNIX text format or the reverse; the program did not seem to function properly at that endeavor. Is there a way to turnoff that conversion process in the configuration of gcc? And just where should I look to find that file, or the likes?

Sincerely,

Gregory D. MELLOTT
 
Old 08-28-2006, 01:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
My guess is that it's not the compiler but the runtime library (which
would make sense given that the compiler really should be OS agnostic).

I didn't put any google-time into this, so I may be completely off the
right track :}


Cheers,
Tink
 
Old 08-29-2006, 01:03 PM   #3
gdmellott
LQ Newbie
 
Registered: Jan 2006
Location: Paonia, Colorado USA
Distribution: Red Hat, Debian, trying others.
Posts: 17

Original Poster
Rep: Reputation: 0
Found the bug [gcc file i/o conversion].

HI,

Feel a bit stupid. The only excuse I have is that it was not in the book. If files are opened in binary mode the conversion CRLF to LF <in> and LF to CRLF <out. is not done in the DOS environment. Makes sense as values 13 then 10, as two consecutive bytes, could be about anywhere in binary information.

Sincerely,

Gregory D. MELLOTT
 
  


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
C function to execute a program and return the output of the program ryan.n Programming 4 08-14-2004 10:11 PM
Saving gcc output files to new directory Fe98 Programming 3 12-08-2003 07:18 AM
Want P4, SSE2 output from 386 GCC Wondre Programming 2 01-09-2003 11:03 AM
output in graphic mode with gcc Rex_chaos Programming 9 05-13-2002 09:56 AM
output in graphic mode with gcc Rex_chaos Linux - General 6 05-12-2002 03:53 AM

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

All times are GMT -5. The time now is 09:14 PM.

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