Tag Archives: cpp

The “C” preprocessor: not as cryptic as you’d think

The C preprocessor is a modest macro-expansion language (check out “m4” if you want to see an immodest one).  Basic symbols and function-macros are convenient for giving meaningful names to constants and tiny function calls, with the rewarding feeling that … Continue reading

Posted in bit shift, preprocessor | Tagged , , , , , , | 6 Comments

Perl for #defines

Did you ever see a declaration or #define in the middle of a header file riddled with #if‘s … and when you compile with file, the desired lines don’t get included? Should you have specified -D_USE_BSD? -DPOSIX? Both? For example, … Continue reading

Posted in Uncategorized | Tagged , , , | 2 Comments

Stupid gcc trick #2: finding all included files, recursively

“C” programmers live in a love-hate relationship with #include files. They make it possible to import and ignore details of implementation; but sometimes, you really want to know about the implementation. For example, suppose you want to find the definition … Continue reading

Posted in Uncategorized | Tagged , , | 3 Comments