Hi All

I am trying to compile 'test.cc' (code attached) with the gcc 4.0.1
it gives me the following error:

test.cc:19: error: array bound is not an integer constant

so it is not able to evaluate the conditional expression in gcc 4.0.1,
while this is being compile by gcc 3.4 without any errors.

Is this a bug in gcc 4.0.1

Any help will be appreciated.

Thanks
Inder.




----------------------------------------------- test.cc
-----------------------------------------------
#include <stddef.h>

typedef struct
{
 int length;
 int a;
 int b;
}CYANBUFFER;

typedef struct
{
 int a;
 int length;
}tNPMessage;



#define my_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
int hello[my_offsetof(CYANBUFFER, length)==my_offsetof(tNPMessage,
length)?10:1];

int main()
{
 return 0;
}

----------------------------------------------- test.cc
-----------------------------------------------

Reply via email to