|
| 1 | + |
| 2 | +# unknownMacro |
| 3 | + |
| 4 | +**Message**: There is an unknown macro here somewhere. Configuration is required. If AAA is a macro then please configure it. [unknownMacro] |
| 5 | +<br/> |
| 6 | +**Category**: Configuration<br/> |
| 7 | +**Severity**: Error<br/> |
| 8 | +**Language**: C and C++ |
| 9 | + |
| 10 | +## Description |
| 11 | + |
| 12 | +Cppcheck has found code that is confusing and does not know how to analyze it. Analysis is aborted. |
| 13 | + |
| 14 | +Your code is probably OK but you need to configure Cppcheck to understand the code better. |
| 15 | + |
| 16 | +## How to fix |
| 17 | + |
| 18 | +Review the configuration. |
| 19 | + |
| 20 | +If Cppcheck warns about a macro that is defined in a header, make sure that this header is included properly Cppcheck must have the include path. |
| 21 | + |
| 22 | +If Cppcheck warns about a compiler keyword add a `-D` that defines this keyword somehow. I.e. if cppcheck should just ignore the keyword then |
| 23 | +an `-DKEYWORD=` option is suggested. |
| 24 | + |
| 25 | +## Example |
| 26 | + |
| 27 | +### Example code 1 |
| 28 | +``` |
| 29 | + fprintf(stderr, "Generating up to " F_U64 " sequences and up to " F_U64 " bases.\n", nSeqs, nBases); |
| 30 | +``` |
| 31 | + |
| 32 | +Warning: |
| 33 | + |
| 34 | +canu-2.2/src/seqrequester/src/seqrequester/generate.H:72:41: error: There is an unknown macro here somewhere. Configuration is required. If F_U64 is a macro then please configure it. [unknownMacro] |
| 35 | + |
| 36 | +Fix: |
| 37 | + |
| 38 | +Somehow `F_U64` must be specified for Cppcheck to be able to analyse this properly. Either: |
| 39 | + * Add `-DF_U64="x"` to explicitly tell Cppcheck what it should replace F_U64 with. Or; |
| 40 | + * Add `-I..` so that headers are included properly. |
| 41 | + |
| 42 | + |
| 43 | +### Example code 2 |
| 44 | +``` |
| 45 | +BOTAN_FUNC_ISA("crypto") |
| 46 | +void AES_128::hw_aes_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const |
| 47 | +``` |
| 48 | + |
| 49 | +Warning: |
| 50 | + |
| 51 | +ftp://ftp.de.debian.org/debian/pool/main/b/botan/botan_2.19.5+dfsg.orig.tar.xz |
| 52 | +botan-2.19.5+dfsg/src/lib/block/aes/aes_power8/aes_power8.cpp:103:1: error: There is an unknown macro here somewhere. Configuration is required. If BOTAN_FUNC_ISA is a macro then please configure it. [unknownMacro] |
| 53 | + |
| 54 | +Fix: |
| 55 | + |
| 56 | +Somehow `BOTAN_FUNC_ISA` must be specified for Cppcheck to be able to analyse this properly. Either: |
| 57 | + * Add `-DBOTAN_FUNC_ISA(X)=` to explicitly tell Cppcheck that BOTAN_FUNC_ISA("crypto") should be ignored. Or; |
| 58 | + * Add `-I..` so that headers are included properly. |
| 59 | + |
| 60 | + |
| 61 | + |
0 commit comments