I am having a situation where #define in one of the header files breaks an enum declaration in another header file.
Using -E switch on gcc I’ve established that I have
#define OFF 0
somewhere.
Question is, how do I find out where? The project is huge, dozens of include directories, hundreds of include files. I’ll do a global grep eventually, but the question is, is there any way to ask the gcc compiler where #define occurs? It obviously has that information!
Update: thanks for not one but two solutions – SO comes through.
Just for the record, the culprit was one of the Sybase client libraries’ includes (ctlib, not even dblib). Ouch.
You can redefine it (to a different value). Then the gcc will tell you where it is already defined.
On my system it looks like this: