In an xcode4.5 project I have turned on pedantic
warnings. But this now gives me a warning about using #warning
:
Lexical preprocessor issue
#warning is language extension
Firstly, I'd like to know why this is happening and how to stop it (with out removing the #warning).
to do away with by or as by authority; abolish; stop (a practice, custom, etc.). to keep in or repress (a feeling, smile, groan, etc.).
n. 1. a conscious effort to put disturbing thoughts and experiences out of mind, or to control and inhibit the expression of unacceptable impulses and feelings. It is distinct from the unconscious defense mechanism of repression in psychoanalytic theory.
trojanfoe answered why the issue was emitted (+1).
A more portable and language-compliant way to emit your warning message is:
#pragma message("YOUR WARNING HERE")
Clang will emit one warning (specifically, the one you wrote in the message -- not the pedantic one), and it appears in Xcode's issues.
The reason it's being generated is because #warning
is an extension to the ISO standard and that is what -pedantic
is about.
It looks like only a #pragma
will turn it off as no -Wno-xxx
flags appear available for language extensions.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-pedantic"
#warning blah blah blah
#pragma clang diagnostic pop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With