This file is not analyzed. Cppcheck failed to extract a valid configuration. The tested configurations have these preprocessor errors:
'' : [D:/xxxxx/QCBOR-1.2/src/qcbor_decode.c:1023] #error QCBOR_TYPE_BYTE_STRING no lined up with major type
QCBOR_DISABLE_FLOAT_HW_USE : [D:/xxxxx/QCBOR-1.2/src/qcbor_decode.c:1023] #error QCBOR_TYPE_BYTE_STRING no lined up with major type
QCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS : [D:/xxxxx/QCBOR-1.2/src/qcbor_decode.c:1023] #error QCBOR_TYPE_BYTE_STRING no lined up with major type
QCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS : [D:/xxxxx/QCBOR-1.2/src/qcbor_decode.c:1023] #error QCBOR_TYPE_BYTE_STRING no lined up with major type
QCBOR_DISABLE_TAGS : [D:/xxxxx/QCBOR-1.2/src/qcbor_decode.c:1023] #error QCBOR_TYPE_BYTE_STRING no lined up with major type
_MSC_VER : [D:/xxxxx/QCBOR-1.2/src/qcbor_decode.c:1023] #error QCBOR_TYPE_BYTE_STRING no lined up with major type
But looking to line 1022 of qcbor_decode.c I see #if CBOR_MAJOR_TYPE_BYTE_STRING + 4 != QCBOR_TYPE_BYTE_STRING
and this expands to CBOR_MAJOR_TYPE_BYTE_STRING as 2
and QCBOR_TYPE_BYTE_STRING as 6
defined in the include files qcbor_common.h and qcbor_decode.h
I don't understand the reason for the messages, and the reason why the file is not analyzed.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried with cppcheck on my Windows 10 machine.
If I try to run cppcheck,exe -I inc --force src/qcbor_decode.c
from the command line, it works.
But if I try from the GUI Analyze >> Files and I select qcbor_decode.c I get the above error.
Even if I have enabled Edit >> Preferences >> General >> Force checking all #ifdef configurations
I think that the trick is passing the -I option to the command line.
How can I pass an include folder from the GUI?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used Cppcheck 2.10 to analyze the source code of QCBOR library https://github.com/laurencelundblade/QCBOR
I get a message on qcbor\qcbor_decode.c saying
But looking to line 1022 of qcbor_decode.c I see
#if CBOR_MAJOR_TYPE_BYTE_STRING + 4 != QCBOR_TYPE_BYTE_STRING
and this expands to
CBOR_MAJOR_TYPE_BYTE_STRING
as2
and
QCBOR_TYPE_BYTE_STRING
as6
defined in the include files qcbor_common.h and qcbor_decode.h
I don't understand the reason for the messages, and the reason why the file is not analyzed.
Thanks
it works for me:
$ ~/cppcheck/cppcheck -Iinc src/qcbor_decode.c
Checking src/qcbor_decode.c ...
Checking src/qcbor_decode.c: QCBOR_CONFIG_DISABLE_EXP_AND_MANTISSA...
Checking src/qcbor_decode.c: QCBOR_DISABLE_FLOAT_HW_USE...
...
Last edit: Daniel Marjamäki 2023-02-01
I tried with cppcheck on my Windows 10 machine.
If I try to run
cppcheck,exe -I inc --force src/qcbor_decode.c
from the command line, it works.
But if I try from the GUI Analyze >> Files and I select qcbor_decode.c I get the above error.
Even if I have enabled Edit >> Preferences >> General >> Force checking all #ifdef configurations
I think that the trick is passing the
-I
option to the command line.How can I pass an include folder from the GUI?
Please create a cppcheck project. In the GUI:
* File menu
* New Project...