Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





  Mapping old rules to new
Posted by: phaedsys - 23-09-2004, 07:43 AM - Forum: MISRA C - No Replies

Hi

Please note theat MISRA-C2 contains an appendix showing all the mapping from C1 to C2 rules.

Regards

Print this item

  MISRA C:1998 Rule 104 and rule 105
Posted by: Jonas Hansryd - 21-09-2004, 09:07 AM - Forum: General Questions - Replies (5)

First, good idea to set up the forum, hope it will be frequently visited by engineers working with Misra C. Nice to be one of the first users of the forum :-)

As there is no section specifically dedicated to Misra C:1998 I place my question in the general question section.

What is the intended interpretation of Misra C:1998 rules 104 and 105?

Misra C:1998 rule 104 reads \"Non-constant pointers to functions shall not be used\"
One may interpret this rule as that the only allowed use and declaration of a function pointer is as in the example below

Example:

Code:
typedef U16_t( *const MyFuncPointer_t) (U16_t);

U16_t MyFunc(U16_t MyInput)
{
  return (MyInput + 2u);
}

MyFuncPointer_t MyFuncPointer = MyFunc;

void main(void)
{
     printf(\"\\nReturn: %i\\n\\n\",MyFuncPointer(4u));
}

If the above interpretation is correct, then the function pointer should always be declared as a constant and can never point at another function during runtime.

Rule 105 reads: \"All the functions pointed to by a single pointer to function shall be identical in the number and type of parameters and the return type\".

We interpret rule 105 as it is allowed for one single function pointer to point at diffferent functions during runtime. But with the conservative interpretation of rule 104, a function pointer may never change the function it points at during runtime and thus conflicts with rule 105, i.e. rule 105 would be superfluous.

What would be the correct way to interpret rule 104 and rule 105?

Print this item

  C1 to C2 mapping
Posted by: phaedsys - 20-09-2004, 01:11 PM - Forum: MISRA-C:1998 to MISRA-C:2004 migration - No Replies

Hi,

there is an appendix in MISRA-C2 that maps all the C1 rules to theC2 rules. This will enable speedy remapping of development processes.

Print this item

  MISRA-C2 cover
Posted by: phaedsys - 20-09-2004, 12:59 PM - Forum: General Questions - Replies (1)

Can anyone identify the place in the cover of MISRA-C2?

We it was better than \"this is a test \" :-)

Print this item

  MISRA-C:2004 rules forum
Posted by: david ward - 16-09-2004, 01:31 PM - Forum: MISRA C - No Replies

Now that MISRA-C:2004 has been published, this forum is available for discussing the individual rules.

The discussions are grouped by rule subject according to the contents structure of MISRA-C:2004.

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,161
» Latest member: Navya Gangaiah
» Forum threads: 996
» Forum posts: 2,745

Full Statistics

Online Users
There are currently 227 online users.
» 0 Member(s) | 225 Guest(s)
Bing, Google

Latest Threads
MISRA AC EC guidelines
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
Yesterday, 08:21 AM
» Replies: 4
» Views: 15,160
News on future releases
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
Yesterday, 08:05 AM
» Replies: 1
» Views: 5,532
Signal naming convention ...
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
Yesterday, 07:57 AM
» Replies: 1
» Views: 7,056
A18-9-4
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
15-10-2024, 09:58 AM
» Replies: 0
» Views: 62
Rule 7.0.2: operator cons...
Forum: 4.7 Standard conversions
Last Post: karos
14-10-2024, 08:52 PM
» Replies: 2
» Views: 176
MISRA 2023 Test Suite
Forum: General Questions
Last Post: grigdon
14-10-2024, 01:27 PM
» Replies: 0
» Views: 69
MISRA C:2023 ADD4
Forum: MISRA resources
Last Post: david ward
11-10-2024, 07:41 PM
» Replies: 0
» Views: 82
MISRA C:2023 ADD2
Forum: MISRA resources
Last Post: david ward
11-10-2024, 07:40 PM
» Replies: 0
» Views: 77
Rule 0.1.9 - is zero-init...
Forum: 6.0 Language independent issues (C++)
Last Post: misra cpp
11-10-2024, 02:46 PM
» Replies: 3
» Views: 475
Does Directive 5.7.2 appl...
Forum: 4.5 Lexical conventions
Last Post: misra cpp
04-10-2024, 02:48 PM
» Replies: 1
» Views: 206