Article View: comp.lang.c.moderated
Article #2658Re: Compiling DOS source on Unix
From: Tom Duff
Date: Tue, 16 Feb 1999 00:00
Date: Tue, 16 Feb 1999 00:00
27 lines
1941 bytes
1941 bytes
Ketil Z Malde wrote: > I have a bunch of sources that were written on PCs, thus with CRLF > line termination. I want to compile them on a Unix system, or > specifically, with GCC on Linux, which uses LF line termination. > > Now all this is just fine and dandy, except some of the sources > contain \CRLF line continuation, which GCC interprets as a stray \CR > at the end of the line, and consequentially, crash and burn. > > I've been unsuccessfully toying with macro defining the problem away, > and I've been searching for cpp options to inhibit this - I'd rather > not mess up the original sources. Surely, somebody must have had this > problem before, and solved it somehow? You pretty much have to rewrite the source code to fix this. One way would be to write a Makefile rule that looks something like this: .c.o: tr -d '\015' <$*.c >$*.nocr.c cc -c -o $*.o $*.nocr.c rm -f $*.nocr.c -- Tom Duff. Ways and Means. -- comp.lang.c.moderated - clcm@plethora.net
Technical Details
Message-ID:
<clcm-19990216-0010@plethora.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<clcm-19990215-0011@plethora.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f65d0,cf2e8be01827b0a6 X-Google-Attributes: gidf65d0,public X-Google-Thread: 100850,cf2e8be01827b0a6 X-Google-Attributes: gid100850,public From: Tom Duff <td@pixar.com> Subject: Re: Compiling DOS source on Unix Date: 1999/02/16 Message-ID: <clcm-19990216-0010@plethora.net> X-Deja-AN: 445040535 X-Old-trace: sherman.pixar.com 919193260 16250 138.72.30.83 (16 Feb 1999 19:27:40 GMT) Content-Transfer-encoding: 7bit Approved: clc@plethora.net References: <clcm-19990215-0011@plethora.net> X-Accept-language: en Content-Type: text/plain; charset=us-ascii X-Trace: ptah.visi.com 919193687 205.166.146.5 (Tue, 16 Feb 1999 13:34:47 CDT) Organization: columnar X-Old-complaints-to: abuse@pixar.com Mime-Version: 1.0 NNTP-Posting-Date: Tue, 16 Feb 1999 13:34:47 CDT Newsgroups: comp.lang.c.moderated,gnu.gcc Originator: clcm@plethora.net (Comp Lang C'Moderated)