Part Number:TMS320F28377S
Tool/software: TI C/C++ Compiler
Wrong MISRA-C :2004 warning:
../main.c", line 73: warning #1483-D: (MISRA-C:2004 12.6/A) Expressions that are effectively Boolean should not be used in operations with expressions that are not effectively Boolean
Code for reproducing:
typedefunsignedintu16_t;
voidtestme(u16_t u16_tv);
typedefstruct {
u16_tau16_test[6];
u16_tu16_tw;
} ST_Test;
ST_Test mast_test[3];
voidtestme(u16_t u16_tv)
{
mast_test[0].u16_tw = u16_tv + 0u;
mast_test[0].u16_tw = u16_tv;
}
/**
* Application entry point
*/
voidmain(void)
{
testme(23u);
}
Full build output:
**** Build of configuration Debug for project boot ****
"D:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O
Building file: "../main.c"
Invoking: C2000 Compiler
"D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O0 --opt_for_speed=2 --include_path="C:/Users/L029453/DSPbase2/ti_boot" --advice:performance=all -g --c89 --relaxed_ansi --diag_warning=225 --diag_wrap=off --display_error_number -k --asm_listing --check_misra="all,-1.1,-2.2,-5.7,-11.3,-17.4" --preproc_with_compile --preproc_dependency="main.d_raw" "../main.c"
"../main.c", line 73: warning #1483-D: (MISRA-C:2004 12.6/A) Expressions that are effectively Boolean should not be used in operations with expressions that are not effectively Boolean
Finished building: "../main.c"
Building target: "boot.out"
Invoking: C2000 Linker
"D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O0 --opt_for_speed=2 --advice:performance=all -g --c89 --relaxed_ansi --diag_warning=225 --diag_wrap=off --display_error_number -k --asm_listing --check_misra="all,-1.1,-2.2,-5.7,-11.3,-17.4" -z -m"boot.map" --stack_size=0x200 --warn_sections --reread_libs --diag_wrap=off --display_error_number --xml_link_info="boot_linkInfo.xml" --rom_model -o "boot.out" "./adc.obj" "./bootF2837x.obj" "./devsys.obj" "./flash.obj" "./gpio.obj" "./main.obj" "./ramcheck.obj" "./wdog.obj" "../linkerF2837x.cmd"
<Linking>
Finished building target: "boot.out"