I am trying to check my code that was written in C++. I pass the std=c++11 flag to cppcheck (I am using the GUI) but I keep getting: Skipping configuration 'bool' since the value of 'bool' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
Any ideas on how to over come this? This information warning makes me think that mavbe other C++11 features are not properly checked as well.
Thank you
Sebastian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I could not reproduce this on a small test case.
Apparently there are some system includes that define bool.
I am sorry for not thinking about checking it this way before posting.
I am trying to check my code that was written in C++. I pass the std=c++11
flag to cppcheck (I am using the GUI) but I keep getting: Skipping
configuration 'bool' since the value of 'bool' is unknown. Use -D if you
want to check it. You can use -U to skip it explicitly.
Any ideas on how to over come this? This information warning makes me
think that mavbe other C++11 features are not properly checked as well.
What version of Cppcheck are you using?
Does it work when you change the std to c++14?
Can you provide some minimal example code piece where that issue happens?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I could not reproduce this on a small test case.
Apparently there are some system includes that define bool.
I am sorry for not thinking about checking it this way before posting.
Thank you very much
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the response.
Maybe it is useful to exclude the system includes or not adding them to the includes. It is recommended for Cppcheck analysis to not use standard/system includes but use the library configurations that come with Cppcheck.
I have tried to reproduce the message that you got regarding unknown configuration of "bool" and i got it for example when using code like this:
#ifdef bool#endifvoidf(boola){}
Cppcheck output:
$ ./cppcheck --enable=all bool.cpp
Checking bool.cpp ...
[bool.cpp:4]: (information) Skipping configuration 'bool' since the value of 'bool' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
Checking bool.cpp: bool...
[bool.cpp:4]: (style) The function'f' is never used.
If you know that bool should always be bool you can call Cppcheck with -Dbool=bool:
$ ./cppcheck --enable=all -Dbool=bool bool.cpp
Checking bool.cpp ...
Checking bool.cpp: bool=bool...
[bool.cpp:4]: (style) The function'f' is never used.
I you have further questions or find out more about this case it would be great if you let us know :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to check my code that was written in C++. I pass the std=c++11 flag to cppcheck (I am using the GUI) but I keep getting: Skipping configuration 'bool' since the value of 'bool' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
Any ideas on how to over come this? This information warning makes me think that mavbe other C++11 features are not properly checked as well.
Thank you
Sebastian
Hello.
I could not reproduce this on a small test case.
Apparently there are some system includes that define bool.
I am sorry for not thinking about checking it this way before posting.
Thank you very much
On Tue, Mar 26, 2019 at 6:23 PM Sebastian Cabot scabot@users.sourceforge.net wrote:
What version of Cppcheck are you using?
Does it work when you change the
std
to c++14?Can you provide some minimal example code piece where that issue happens?
Hello.
I could not reproduce this on a small test case.
Apparently there are some system includes that define bool.
I am sorry for not thinking about checking it this way before posting.
Thank you very much
Thanks for the response.
Maybe it is useful to exclude the system includes or not adding them to the includes. It is recommended for Cppcheck analysis to not use standard/system includes but use the library configurations that come with Cppcheck.
I have tried to reproduce the message that you got regarding unknown configuration of "bool" and i got it for example when using code like this:
Cppcheck output:
If you know that
bool
should always bebool
you can call Cppcheck with-Dbool=bool
:I you have further questions or find out more about this case it would be great if you let us know :)