Mail Archives: djgpp/1997/02/07/15:56:18
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 -