CMock: gcc -Wno-pragmas doesn't work
I keep getting warnings about using #pragma once in header files, like below:
Test 'test_util_double_buffer.c'
--------------------------------
src/util/util_assert.h:1:9: warning: #pragma once in main file
#pragma once
^~~~
Compiling test_util_double_buffer_runner.c...
I can’t figure out how to turn them off. Theoretically I should be able to pass -Wno-pragmas (for gcc) or -Wno-pragmas-outside-main (for clang) but neither option seems to shut it up. Is there something I am missing?
I pass the arguments as follows (in my ceedling project.yml file), but it doesn’t remove the warnings
:flags:
:test:
:compile:
:*:
- -Wno-int-to-pointer-cast
- -Wno-pointer-to-int-cast
- -Wno-pragmas
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (4 by maintainers)
@mvandervoord okay that makes sense. I can’t disable preprocessing, since I have a ton of #ifdefs and stuff. How can I provide
-wno-pragmas
to the preprocessor? I can’t find any answers in the docs – it doesn’t appear that there is a preprocessor option in:flags: :test:
, and passing it as a test compiler flag does’t get rid of the warningThe following are all the flag options in the docs: