I think that I now mostly understand the code that you posted. You're right about gcc. I suggest that you do most of your testing with a C compiler. There is a lot of code out there that happily states "gcc required", a situation simliar to those "IE required" web pages.
You are doing a lot of "typedef struct X { } X". That makes X both a typedef and name of a stucture. Unless you have a very good reason for that, just use "typedef struct { } X".
When you do "#define X_NS_C (X) {...}", what function is the (X) supposed to serve? That is the one part that I can't figure out. I finally just assumed it was a comment and dropped it.
You need a \n in your printf. I never could get my version of gcc to compile your program. When you run your program after a gcc compile, do you get a trailing \n somehow?
The exit(1) is interesting, but I couldn't resist the urge to switch it to exit(0).
#include <stdlib.h>
#include <stdio.h>
typedef struct {
int E;
int F;
} TEST3;
typedef struct {
int C;
TEST3 D;
} TEST2;
typedef struct {
int A;
TEST2 B;
} TEST;
#define TEST_NS_C { 1, TEST2_NS_C }
#define TEST2_NS_C { 2, TEST3_NS_C }
#define TEST3_NS_C { 6, 8 }
main(int argc, char *argv[])
{
TEST T = TEST_NS_C;
printf("%d %d %d %d \n", T.A, T.B.C, T.B.D.E, T.B.D.F);
exit(0);
}
Of course, in real life, I would lose those #defines and just go with:
TEST T = { 1, { 2, { 6, 8 } } };
but I guess that you need those defines for some reason. Do you really need to split them to several lines? Even machine generated C code should be readable.
I have tried my code on several c compilers. HP's c++ compiler issued a warning because main() is not typed, but the resulting program ran fine. Other than that, it compiled fine everywhere, including with gcc.
You lost me with that NO_STATEMENT stuff...I hope that wasn't too important.