This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bug again: MISRA-C Rule 19.1 Misreported by arm compiler



#ifdef SOME
#include <stdint.h>
#else
#include <string.h>
#endif

void test() {
}

Command line:

C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/bin/armcl --include_path="C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" -mv7R4 --code_state=32 --float_support=VFPv3D16 -O4  --check_misra="19.1" -g --strict_ansi --emit_warnings_as_errors --diag_wrap=off --diag_warning=225 --display_error_number --abi=eabi --enum_type=packed --preproc_with_compile misra_19_1.c

Output:

"misra_19_1.c", line 4: error #1425: (MISRA-C:2004 19.1/A) #include statements in a file should only be preceded by other preprocessor directives or comments
1 error detected in the compilation of "misra_19_1.c".

 

PS: facepalm.jpg

Why you not hire software testers?

  • Thank you for notifying us of this problem, and for submitting a concise test case. I can reproduce the problem. I filed CODEGEN-1640 in the SDOWP system to have this investigated. You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George