But if I import the boost_1_66_0, the result will misrecognize many issues about boost, and cannot detect the real error in main.cpp. Does anybody can solve this problem?
[/usr/local/include/boost/preprocessor/config/config.hpp:92]:(error)#elif without #if[/usr/local/include/boost/config.hpp:39]:(error)Noheaderin#include[/usr/local/include/boost/algorithm/string/std/slist_traits.hpp:16]:(error)Noheaderin#include[/usr/local/include/boost/preprocessor/variadic/elem.hpp:92]:(error)#endif without #if[/usr/local/include/boost/preprocessor/config/config.hpp:82]:(error)failedtoexpand'BOOST_PP_VARIADICS_MSVC',Invalid## usage when expanding 'BOOST_PP_VARIADICS_MSVC'.[/usr/local/include/boost/config.hpp:57]:(error)Noheaderin#include[/usr/local/include/boost/config.hpp:48]:(error)Noheaderin#include[/usr/local/include/boost/config.hpp:30]:(error)Noheaderin#include(information)Cppcheckcannotfindalltheincludefiles(use--check-configfordetails)
Last edit: 顾涛明 2018-04-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can reproduce this.
While Cppcheck is not really meant to work with system/library include files (better use library configurations for that), i think there is also a problem with parsing the boost header file.
This could maybe really be an issue relevant to Cppcheck.
For code like this (similar to boosts config.hpp):
## if 1# define a 1# endifintmain(){printf("%d",a);}
simplecpp (part of Cppcheck) reports this error:
$./simplecppinclude.hpp
include.hpp:4:syntaxerror:#endif without #if
Removing the single # at the top makes it work again.
Last edit: versat 2018-04-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A short update: The issue #125 has been fixed in simplecpp and it already works better parsing the boost headers, but there is still an issue.
I created issue #126 for simplecpp which addresses the new problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the above code, the following command can detect the error:
But if I import the boost_1_66_0, the result will misrecognize many issues about boost, and cannot detect the real error in main.cpp. Does anybody can solve this problem?
Last edit: 顾涛明 2018-04-12
I can reproduce this.
While Cppcheck is not really meant to work with system/library include files (better use library configurations for that), i think there is also a problem with parsing the boost header file.
This could maybe really be an issue relevant to Cppcheck.
For code like this (similar to boosts config.hpp):
simplecpp (part of Cppcheck) reports this error:
Removing the single
#
at the top makes it work again.Last edit: versat 2018-04-12
I created this issue for simplecpp.
Thank you very much!
A short update:
The issue #125 has been fixed in simplecpp and it already works better parsing the boost headers, but there is still an issue.
I created issue #126 for simplecpp which addresses the new problem.