The only way I have found around this problem (perhaps there are other, better methods I do not know of) is to keep C files in targets (or projects if I am using a workspace) separate from the C++ files, and defining per-target (or per-project) build options instead of global ones.