MISRA Discussion Forums
in the Example Suite, D_04_02.c - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA C:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21)
+---- Forum: 7.4 Code design (https://forum.misra.org.uk/forumdisplay.php?fid=181)
+---- Thread: in the Example Suite, D_04_02.c (/showthread.php?tid=1118)



in the Example Suite, D_04_02.c - ogawa.kiyoshi - 13-10-2014

In MISRA C:2012 Examples Suite, D_04_02.c has no function.
If you compile D_04_support.c or D_04_system.c then a link error should be occured.

For example, at LLVM(clang)
"_D_4_2", referenced from:
_D_4_main_support in D_04_support.o
_main in D_04_system.o
ld: symbol(s) not found

You could compile with adding a function D_4_2(){} in D_04_02.c or removing D_4_2( ); in D_04_support.c and D_04_system.c.

BTY.
In the Example suite, xx_system call xx_support, but both of them have same individual function calls.
it may be redundant.

Dr. OGAWA Kiyoshi


Re: in the Example Suite, D_04_02.c - misra-c - 30-10-2014

You are correct that the following functions have a declaration, but no definition
D_1_1
D_2_1
D_3_1
D_4_2
R_1_1
R_1_2
R_1_3
This will be corrected in a later version of the Example suite, by removing them from the support and system files.

The inclusion of the same individual function calls in xx_system and xx_support was intentional. One aim when producing the Example suite was to minimize the violations of other rules. The presence of calls of externally declared function in two different files means that the number rule 8.7 violations is minimised.