using cppcheck v1.86 (Debian unstable) gives me headaches with errors
(and thus files beign skipped) with the attached file.
It says (wrongly):
The tested configurations have these preprocessor
errors:\012HAVE_CONFIG_H=1 : [gl/c-ctype.h:78] #error "Only ASCII and
EBCDIC are supported"
I have only added the options at the end: --enable=information -v --output-file=cppcheck_lib_output.txt
Neither with 1.86 nor with git head i was able to reproduce the issue.
I have attached the output files.
The only thing that does not look correct are these messages:
Hi,
using cppcheck v1.86 (Debian unstable) gives me headaches with errors
(and thus files beign skipped) with the attached file.
It says (wrongly):
The tested configurations have these preprocessor
errors:\012HAVE_CONFIG_H=1 : [gl/c-ctype.h:78] #error "Only ASCII and
EBCDIC are supported"
See also: https://gitlab.com/gnutls/gnutls/issues/705
Removing that part from the file and hard-coding C_CTYPE_ASCII works nicely.
Maybe there is a known work-around !? If not and you consider this a
bug, could someone file a bug in the issue tracker, please ?
Thanks so much for cppcheck ! Tim
BTW, the problematic part is
#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
/ The character set is ASCII or one of its variants or extensions, not
EBCDIC.
Testing the value of '\n' and '\r' is not relevant. */
define C_CTYPE_ASCII 1
#elif ! (' ' == '\x40' && '0' == '\xf0' \
&& 'A' == '\xc1' && 'J' == '\xd1' && 'S' == '\xe2' \
&& 'a' == '\x81' && 'j' == '\x91' && 's' == '\xa2')
error "Only ASCII and EBCDIC are supported"
endif
can you try to format it better. There is a button that looks like
</>
that you use for code.when I check c-ctype.h I get no error. could you please try to create a small test case that reproduce the problem?
I downloaded gnutls-master.zip and copied the commands together to execute cppcheck manually:
I have only added the options at the end:
--enable=information -v --output-file=cppcheck_lib_output.txt
Neither with 1.86 nor with git head i was able to reproduce the issue.
I have attached the output files.
The only thing that does not look correct are these messages:
I would expect Cppcheck to always define
__FILE__
and__LINE__
.But for code like this:
Cppcheck (1.86 and head) outputs this:
Not sure if that is intended or useful.
Btw.: I recommend to also use the option
--library=gnu
for gnutls. It defines such things likeunlikely()
,likely()
and other GNU stuff.Last edit: versat 2019-02-15