in the Example Suite, D_04_02.c

Moderators: misra-c, david ward

Post Reply
ogawa.kiyoshi
Posts: 15
Joined: Fri May 27, 2005 10:08 am
Company: NMIRI, Gifu-University, TOPPERS project
Location: Japan

in the Example Suite, D_04_02.c

Post by ogawa.kiyoshi » Mon Oct 13, 2014 7:19 am

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
Dr. OGAWA Kioshi
@kaizen_nagoya

misra-c
Posts: 556
Joined: Thu Jan 05, 2006 1:11 pm

Re: in the Example Suite, D_04_02.c

Post by misra-c » Thu Oct 30, 2014 8:41 am

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.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “7.4 Code design”