www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/21/12:08:34

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: parse error
Date: Tue, 21 Dec 1999 10:52:19 +0000
Organization: Customer of Planet Online
Lines: 25
Message-ID: <hflu5sk8344g0ost23f8k3j5fvg1garqn9@4ax.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 991220103732 DOT 6937A-100000 AT is> <385e057b AT news DOT uni-bielefeld DOT de>
NNTP-Posting-Host: modem-68.sodium.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news5.svr.pol.co.uk 945773630 9810 62.136.5.68 (21 Dec 1999 10:53:50 GMT)
NNTP-Posting-Date: 21 Dec 1999 10:53:50 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> >> I think a parse error can happen if line endings aren't correct.  Say a
> >> piece of code compiled and working on Unix systems is compiled with djgpp.
> >
> >Not true: DJGPP has no problems with Unix-style line endings.  All the 
> >sources of GNU packages ported to DJGPP have Unix-style line endings, and 
> >I have never needed to run them through utod.
> >
> >As a matter of fact, beginning with GCC 2.91 (I think), the Unix version 
> >of the compiler can compile sources with DOS-style line endings as well.
> 
> A few weeks ago somebody asked for assistance with his parse errors. And it 
> turned out that he had strange characters (from a Dos /Win view) at the end of 
> his lines. I don't know whether these were unix-style and I don't remember 
> what the actual character was, but they surely were the source of his parse 
> errors. Does anybody remember?

GCC does not recognise CR-only as a line end.  This can be the cause
of some obscure errors:

#include <iostream> // rest of source file won't be read!

Another thing to watch out for is make, the *nix version only accepts
NL line ends and will give some cryptic error messages if it
encounters a CR.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019