www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/07/15:56:18

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: my fault?
Date: Fri, 07 Feb 1997 11:29:02 GMT
Organization: Oxford University
Lines: 30
Message-ID: <32fb111d.3988389@news.ox.ac.uk>
References: <32F99563 DOT 719C AT neopoli DOT lpt DOT fi> <32F9D6C5 DOT 7C87 AT Mathematik DOT tu-chemnitz DOT de> <yksybd1x791 DOT fsf AT ra DOT ibr DOT cs DOT tu-bs DOT de>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 07 Feb 1997 11:03:54 +0100, Till Harbaum
<harbaum AT ra DOT ibr DOT cs DOT tu-bs DOT de> wrote:

>> In file included from cepread.c:2:
>> c:/djgpp/include/stdlib.h:39: parse error before `int'
>
>c:/djgpp/include/stdlib.h:39: 
>	int	abs(int _i);
>
>Hmm, perhaps do you define some kind of abs in a previous
>include file?

This seems likely, for example:
--- foo.h ---
#define abs(x) ((x)<0?(-(x)):(x))
...
--- cepread.c ---
#include "foo.h"
#include <stdlib.h>
...

This would generate an error, because the compiler would be given:

int ((int _i)<0?(-(int _i)):(int _i));

I think the general solution here is to always make sure you include
standard header files before your own non-standard ones.

George Foot
(apologies for the blank article sent first)

- Raw text -


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