How do you disable compiler warnings in uVision 4? It's for a K20
procesor so it's an ARM Cortex M4. I tried the standard C++ #pragma
warning but it didn't sppear to work...
The beauty of a GUI like uVision is you don't have to do all that
tiresome (sic) reading of manuals - you just look through the
dialogues until you see something that says "Warnings" or
There are no standard C++ #pragma warning handling, even if the
#pragma keyword is standard.
#pragma itself may be standard, but the rest of the line isn't
#pragma is an official way to specify compiler-specific attributes
to a compiler.
So whenever you want to use #pragma, you need to locate the
#pragma documentation for the specific compiler. Not only that -
quite a number of compilers think they are "clever" and will generate
warnings for unknown #pragma use - so many compilers will even
require that you quality your #pragma use within #ifdef blocks if you
want silent builds using multiple compilers.
Well I'd like to disable one specific warning, the rest are very
Follow the previously-given links - they will quickly lead you to
I looked at them, I didn't see a way to just turn off one specific
one, just all of them... I don't remember the exact warning off-hand
and I don't have access to my compiler right at the moment.
You didn't follow far enough, then.
Hint: follow the link to the command-line option...
Hmm all I see there is disabling all warnings... I looked all over
those two pages you linked and couldn't find it.
How I hate these half answers certain posters give. It just annoys
and proves nothing (except for the obnoxicity of the writer).
Anyway, you've nearly got it.
You can disable a specific warning. Say you want to disable
warning 161. It can be done either as a command line parameter in the
MiscControls section of
or as a pragma with
#pragma diag_warning 161
So even if you do find where to put the entry into a GUI like
uVision, you still frequently have to find the relevant details
concerning what you have to put in.
Now lets just wait for the protestations from those half
Or will they have been suppressed by my saying the above?
It is nice that someone stands up to typical forum answerers (they
are everywhere) but they are still better than having no help so I
don't want to be ungrateful. I hear you though, forums are not
typically a friendly place to ask questions...
An old Chinese saying:
It's more appreciated to teach one how to fish than to give him a
Give answer without hesitation may deprive him of rights to
For someone's good, I think we could provide him informations,
theories, thoughts, links, references, etc., but never provide the
direct results. HE CAN THINK AND DRAW CONCLUSION BY HIMSELF.
Also I would seldom provide codelets in a forum.
Faith and logic.
There's maybe a few ways to do it but then I would like to know
all the ways and some advice on which one is the best. Giving none of
the ways doesn't really help...
Follow Andrew Neil's links you can find these two reference
By compiler options or by #pragma extensions.
Also a lot more you can configure to direct the compiler how to
compile your application.
So next time my wife can't start her car, I'll tell her to check
the battery and do nothing else.