Next: , Previous: , Up: -W_   [Contents][Index]


4.2.65.4 ‘-WH’: Send additional arguments to the C preprocessor

When the ‘-H’ option (see -H_) is used, the C preprocessor is invoked to scan include header files for typedef’s and class declarations. That is called with a standard set of options. (Presently, gcc is actually called to invoke the preprocessor; it is sent the options ‘-E’, ‘-P’, and ‘-I’.) Occasionally it may be necessary to send additional options. Those can be specified as the (string) argument to ‘-WH’. Thus, to define two macros to the preprocessor, one could say either of

-WH-Dtest1=1 -WH-Dtest2=2
-WH"-Dtest1=1 -Dtest2=2"

The first form shows that ‘-WH’ accretes to earlier uses. The second form shows how to handle embedded blanks (in a UNIX shell). Then, if one were programming in C, use of ‘-H’ would issue the system command

gcc -E -P -Dtest1=1 -Dtest2=2