Preprocessing & #error

Alex Vinokur alexvn@connect.to
Wed Dec 10 08:03:00 GMT 2003


Here is some code.

====== C code : foo.c : BEGIN ======
#define ITEM1 100
#define ITEM2 200
#if (ITEM1 != ITEM2)
#error BUG : ITEM1 != ITEM2
#endif
====== C code : foo.c : END ========

====== Compilation (Preprocessing) : BEGIN ======

$ gcc -v
[---omitted---]
gcc version 3.3.1 (cygming special)

$ gcc foo.c
foo.c:4:2: #error BUG : ITEM1 != ITEM2

====== Compilation (Preprocessing) : END ========


I would like to get the following output :
$ gcc foo.c
foo.c:4:2: #error BUG : 100 != 200


Is it possible?


   =====================================
   Alex Vinokur
     mailto:alexvn@connect.to
     http://mathforum.org/library/view/10978.html
   =====================================









More information about the Gcc-help mailing list