views:

22

answers:

1

I have some Motif code that also uses widgets from the Xmt widget set.
It include both "Xm/XmStrDefs.h" and "Xmt/ComboBox.h".
However, there are some macros that are defined in both files:

// XmStrDefs.h:
#define XmNarrowSize "arrowSize"

// ComboBox.h:
#define XmNarrowSize "arrowSize"

These are system header files that I'm not allow to change. I've heard that gcc has the ability to ignore warnings in system headers.

How can I tell gcc that these headers are system headers?

Alternatively, how do I tell gcc to ignore redefinition errors?

Basically, how can I suppress this warning without changing these headers?

+3  A: 

How can I tell gcc that these headers are system headers?

Use the -isystem switch. See http://gcc.gnu.org/onlinedocs/cpp/System-Headers.html for detail.

gcc -isystem Xm -I <rest of the nonsystem includes> ...
KennyTM
Worked great, thanks!
Bill