[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: [Tinycc-devel] #define problem
From: |
koldo . ramirez |
Subject: |
Fwd: [Tinycc-devel] #define problem |
Date: |
Tue, 21 Apr 2009 08:16:59 +0200 |
Hello all
I repeat the post as I have seen that the tabs chars are replaced by  symbols in the mailing list
Here the post
........
I have found a problem if two #defines apply to the same symbol in the same line.
Here it is a sample code
typedef struct {
double x;
} Demo;
#define pow2(a) (a*a)
#define x (val->x)
double fun(Demo *val)
{
return pow2(x);
}
In line "return pow2(x);" the two defines apply.
Compiling this I get a "10: field not found: (".
I have tested with gcc and msc9 and I do not get any error (but there is no main() in the source).
Best regards
Koldo