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

Username
  

Password
  





  MISRA rule 89
Posted by: perrola - 14-10-2004, 11:36 AM - Forum: 6.19 Preprocessing Directives - Replies (5)

Dear,

I have to design our new familly product SW platform.

To do this, we have introduce in our design the \"components set\" concept, that gathers components that have the same functionnal behaviour and that are interchangeable.
Let's take the example of a driver: we can have driver1 and driver2 that
are interchangeable, do the same job, and part of the same library. They
present the same interface.
During project instanciation from the SW platform, we choose one of them. To manage this, we plan to have a definition of the include file to avoid modifying a generic component that would call these drivers.

Code:
#define COMP_DRIVER     \"driver1.h\"

and in all the components that use this driver, we plan to include the
appropriate header file this way:

Code:
#include COMP_DRIVER

Is this a violation of the MISRA rule 89 ?

Defining the header file this way:

Code:
#define COMP_DRIVER     \"../driver1/driver1.h\"

Is this a violation of the MISRA rule 89 ?

Thank you for your answer.

Best regards

Laurent Perron

Print this item

  MISRA-C: 2004 rules forum
Posted by: david ward - 14-10-2004, 08:03 AM - Forum: Announcements - No Replies

Following the publication of MISRA-C:2004, the subtopics in this forum are now open.

If you have any questions or want to discuss a point about any of the rules in MISRA-C:2004, please post it to the appropriate topic according to the section in the document (e.g. for a question about rule 1.1, post it to forum \"6.1 Environment\").

Print this item

  MISRA-C:2004 published
Posted by: david ward - 14-10-2004, 07:58 AM - Forum: Announcements - No Replies

MISRA-C:2004 \"Guidelines for the use of the C language in critical systems\" has been published.

You can purchase it using a credit or debit card at our new on-line store. Choose \"Buy\" on the MISRA C website, or go directly to http://www.misra.org.uk/buy_now.php

Print this item

  Best way of checking code is compliant - what tool ?
Posted by: DanC - 04-10-2004, 09:17 AM - Forum: General Questions - Replies (2)

The organisation I work for is about to start a series of new products.

Within the organsiation ( 2 sites) of the 8 embedded software engineers, none has any experience of working to any formal standards etc.

Currently we looking at using PC lint from gimpel ( using the MISRA options lnt file) to help test and verify the code is MISRA compliant.

I must admit is was quite educational to try lint just on its own, on the exsisting products code and has generated quite a bit of reworking of code.

Can anyone suggest a better tool or perhaps a training course etc that may ease the introduction of the MISRA standard into our newer products.

Print this item

  MISRA-C and AutoCODE
Posted by: phaedsys - 30-09-2004, 12:00 PM - Forum: General Questions - Replies (1)

Hi,

I heard that some one was developing a sub/superset of MISRA-C for use in autocode generation tools.

Does anyone know anything about this?
Who is doing it?


Regards
Chris

Print this item

  unoffical MISRA-C web site
Posted by: phaedsys - 24-09-2004, 09:42 PM - Forum: General Questions - No Replies

Hi

I run an unoffical MISRA-C web site at http://www.misra-c.org

As it has no connection with MISRA/MIRA I get to post mosr commercial information and other bits and pices.

Print this item

  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

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,125
» Latest member: suzu
» Forum threads: 968
» Forum posts: 2,658

Full Statistics

Online Users
There are currently 198 online users.
» 0 Member(s) | 195 Guest(s)
Bing, Facebook, Google

Latest Threads
Application of Rule 15.0....
Forum: 4.15 Special member functions
Last Post: nehalpatel
14-05-2024, 06:19 PM
» Replies: 0
» Views: 24
10.2.3 Amplification
Forum: 4.10 Declarations
Last Post: hahn
06-05-2024, 08:57 AM
» Replies: 2
» Views: 371
A13-5-4 opposite operator...
Forum: AUTOSAR C++:2014 rules
Last Post: aromauld
26-04-2024, 03:34 PM
» Replies: 0
» Views: 270
C++17 [[fallthrough]]; at...
Forum: 6.6 Statements (C++)
Last Post: mshawa
22-04-2024, 06:29 PM
» Replies: 0
» Views: 256
cvalue and constant integ...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
19-04-2024, 04:53 PM
» Replies: 1
» Views: 311
Rule 6-2-3 and C++17 [[fa...
Forum: 6.6 Statements (C++)
Last Post: misra cpp
19-04-2024, 04:48 PM
» Replies: 1
» Views: 276
Rule 7.0.5 Example potent...
Forum: 4.7 Standard conversions
Last Post: misra cpp
12-04-2024, 01:54 PM
» Replies: 1
» Views: 254
Rule 0.2.4 non-compliant ...
Forum: 4.0 Language independent issues
Last Post: misra cpp
12-04-2024, 01:51 PM
» Replies: 1
» Views: 290
Further guidance on MISRA...
Forum: 8.10 The essential type model
Last Post: mshawa
09-04-2024, 02:29 PM
» Replies: 0
» Views: 238
MISRA AC SLSF:2023 AMD1
Forum: MISRA AC resources
Last Post: david ward
05-04-2024, 01:56 PM
» Replies: 0
» Views: 251