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

Username
  

Password
  





  Complementary documentation on MISRA Rules
Posted by: Nicolette MAZURIER - 11-12-2006, 11:07 AM - Forum: General Questions - No Replies

I am working as a Software Quality Engineer at Siemens VDO in France and we are currently trying to document the consequence(s) of not respecting each of the MISRA rules, in order to make our developers aware of the risk(s). Sometimes this task is quite easy and sometimes less. So I am looking for some documentation that could help us reaching our objective. Today we are still using MISRA 1998, so I am more interested in documents dealing with the correponding rules, but it would also help for the future if some documents on MISRA 2004 exist.

Thanks for Help,

NM

Print this item

  MISRA Autocode Public Review
Posted by: david ward - 08-12-2006, 12:17 PM - Forum: Announcements - No Replies

MISRA has been developing a set of guidelines for users of control system modelling packages. The aim of the guidelines is to provide a set of rules, in a similar fashion to the MISRA C rules, which encourage good modelling practices and avoid poorly-defined features of the modelling language. In light of automotive industry trends, some rules will be aimed at the use of automatic code generators in safety-related systems.

Following the initial activities of this Working Group, MISRA is pleased to announce that drafts of the first documents will be available in the new year for public comment. These documents are:

  • MISRA SLSF - guidelines for users of Simulink and Stateflow
  • MISRA TL - guidelines for users of Targetlink
  • MISRA ACG - guidelines for compliance with MISRA C in automatically-generated code
If you are prepared to receive one or more of these documents for review, please visit the MISRA website to download a reply form and return by post or fax to MIRA. As this form requires a signature to indicate acceptance of the terms, only fully completed and signed copies can be accepted.

Print this item

  MISRAC Rules
Posted by: prabhakarp - 21-11-2006, 10:51 AM - Forum: MISRA-C:1998 to MISRA-C:2004 migration - No Replies

hello all,

can you anyone provide me some documents related to MISRA C rules

thanks

Print this item

  Underlying type of character constants and \"plain char
Posted by: Shane Swenson - 15-11-2006, 12:40 AM - Forum: 6.10 Arithmetic Type Conversions - Replies (4)

We're wondering if rule 10.1 applies to character constants and the \"plain char\" type, and, if so, what their underlying types are. For example,

Code:
char_t c1 = 'a';
char_t c2 = 'abc';
From the discussion in 6.10.4, we expect that the underlying types of 'a' and 'abc' are 8 bit signed and 32 bit signed, respectively, on a target with 8 bit chars.

The underlying types of c1 and c2 are less clear. We could treat \"plain char\" similarly to signed char or unsigned char based on the implementation's signedness of \"plain char\", or from the discussion following rules 6.1 and 6.2, we could deduce that \"plain char\" is distinct from signed char and unsigned char with respect to rule 10.1.

If rule 10.1 applies to character constants, we expect that the assignment to c2 violates rule 10.1 because it probably requires a conversion of the character constant to a narrower type. If the \"plain char\" type is unsigned on the target system, the assignment to c1 could be considered as violating rule 10.1 because it requires a conversion from a signed type to an unsigned type.

If the \"plain char\" type is considered distinct from the signed char and unsigned char types, both assignments would violate rule 10.1 unless the underlying type of a character constant is also \"plain char\", though this also seems problematic since, for example, the plain char type usually can't represent the value 'abc'.

What are the Committee's positions on these issues?

Print this item

  18.4 Unions shall not be used...
Posted by: rahul_mishra - 13-11-2006, 12:58 PM - Forum: 6.18 Structures and Unions - Replies (1)

Is it that unions can be declared or defined but not used? i.e.; Do we need to flag a violation even on the declaration or definition of the union? or is it only on the usage of it.

Print this item

  Rules 11.4 and 11.5: addressing only explicit cast ?
Posted by: lv - 19-10-2006, 12:06 PM - Forum: 6.11 Pointer Type Conversions - Replies (1)

Theses both rules (11.4 and 11.5) prevents against bad casting between pointers.


In my understanding, these both rules are applicable for explicit and implicit cast: The problematic is the same for explicit or implicit cast.


The understanding of my MISRA-checker-tools is that these rules address only explicit cast (these rules give only explicit cast example, and anywhere implicit cast is mentioned).
And this pointer implicit cast is not covered by another MISRA rule (Rules 10.1 and 10.2 don't address pointers cast but only integer and float implicit casts.)

Could you confirm which understanding is the good one?

Thanks in advance.

Print this item

  11.2 Interpretation
Posted by: elmar - 16-10-2006, 06:54 AM - Forum: 6.11 Pointer Type Conversions - Replies (1)

With rule 11.2,

\"Conversions shall not be performed between a pointer to object and any type other than an integral type, another pointer to object type or a pointer to void\"

my understanding of the term

\"another pointer to object type\"

is, that for example code like

int* Source;
long* Target;
Target = (long*)Source;

doesn't violate this rule (but at least violates rule 11.4);
but our misra checker tool's interpretation of this rule is more like

\"another pointer to same object type\"

therefore it emits a misra violation for code structures like the one mentioned above.

To help me out, could you please tell me which interpretation is right?

Thanks in advance,
elmar

Print this item

  unnamed members of a structure
Posted by: rahul_mishra - 13-10-2006, 04:37 AM - Forum: 6.18 Structures and Unions - Replies (1)

Please let me know \"How do we access an unnamed member of a structure\"?

Its quite natural to use bitfields as unnamed members of a structure especially for padding. But, how do we access those unnamed members. Do we have to increment the pointer to access it? if yes, please illustrate it with an example.

Print this item

  12.4 and Non-Returning Functions
Posted by: gs - 03-10-2006, 01:33 PM - Forum: 6.12 Expressions - Replies (1)

Hi,
12.4 prohibits side-effects on the right hand side of '&&' or '||'. What if, on the right hand side, I place a function with no side-effects, provided it returns, but which does contain side-effects if it does not return (e.g., an assertion which writes to a log file of some sort)? Is such a function allowed on the right hand side of the logical operators?

Print this item

  8.5 and a C99 Extension
Posted by: gs - 03-10-2006, 01:26 PM - Forum: 6.8 Declarations and Definitions - Replies (1)

Hi,
I use 'inline' within my code. Not wanting to go into any details, let us just suffice it to say I feel sufficient reason exists for me to do so. Does 8.5 apply to inline functions? Does the use of 'inline' supercede the restriction of 0 function definitions per header?

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,118
» Latest member: mohana
» Forum threads: 967
» Forum posts: 2,656

Full Statistics

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

Latest Threads
C++17 [[fallthrough]]; at...
Forum: 6.6 Statements (C++)
Last Post: mshawa
22-04-2024, 06:29 PM
» Replies: 0
» Views: 20
cvalue and constant integ...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
19-04-2024, 04:53 PM
» Replies: 1
» Views: 185
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: 142
10.2.3 Amplification
Forum: 4.10 Declarations
Last Post: misra cpp
12-04-2024, 02:20 PM
» Replies: 1
» Views: 164
Rule 7.0.5 Example potent...
Forum: 4.7 Standard conversions
Last Post: misra cpp
12-04-2024, 01:54 PM
» Replies: 1
» Views: 143
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: 164
Further guidance on MISRA...
Forum: 8.10 The essential type model
Last Post: mshawa
09-04-2024, 02:29 PM
» Replies: 0
» Views: 80
MISRA AC SLSF:2023 AMD1
Forum: MISRA AC resources
Last Post: david ward
05-04-2024, 01:56 PM
» Replies: 0
» Views: 91
MISRA AC GMG:2023 release...
Forum: MISRA AC GMG discussions
Last Post: misra-ac
25-03-2024, 06:01 PM
» Replies: 2
» Views: 449
14.3 and enum constants i...
Forum: 8.14 Control statement expressions
Last Post: misra-c
24-03-2024, 01:08 PM
» Replies: 1
» Views: 349