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

Username
  

Password
  





  MISRA Safety Case guidelines public review
Posted by: david ward - 09-11-2016, 11:30 AM - Forum: Announcements - No Replies

MISRA is pleased to announce that a draft of its “Guidelines for Automotive Safety Case Arguments” will shortly be available for public review. The ISO 26262 standard defines a safety case as an “argument that the safety requirements for an item are complete and satisfied by evidence compiled from work products of the safety activities during development”. This new MISRA document will give practical guidance on a model for structuring automotive safety arguments, although its principles may also be applicable in other sectors.

Update 25 November 2016. The call for reviewers is now closed. Thank you to everyone who has responded and we will be in contact within the next week regarding the next steps in the review process.

Print this item

  Proposal: Rule 0-1-4 exception
Posted by: dg1980 - 27-10-2016, 11:16 AM - Forum: 6.0 Language independent issues (C++) - Replies (2)

Exception: Variables which are written by the program but read by an external entity (e.g. ASAM MCD tools like Vector CANape) are not considered a violation of this rule.

Print this item

  Proposal: Rule 0-1-3 exception
Posted by: dg1980 - 27-10-2016, 11:09 AM - Forum: 6.0 Language independent issues (C++) - Replies (3)

Dear MISRA team,

we have certain variables which are required by our boot loader (a separate binary) but are not used in the main program itself.
In my book, this is not a violation of 0-1-3, because clearly those variables have a usage, albeit one that static analysis cannot prove.
Therefore i would like to propose the following addendum to rule 0-1-3:

Exception: a variable which is required by an external binary program only (e.g. an embedded systems boot loader) is not considered a violation of this rule.

Print this item

  Rule 9-3-2
Posted by: dg1980 - 21-10-2016, 12:07 PM - Forum: 6.9 Classes (C++) - Replies (1)

Dear MISRA team,

i think in the example below, the non-const get_p is a violation of this rule, while the static analysis tool says otherwise.
The compliant example in the document refers to shared data, which is not the case here.
I think it was misinterpreted as "returning a member of type T* is always compliant".
If so, maybe in the next version of the standard this rule needs a better formulation in terms of exceptions.

Code:
FlexeLint for C/C++ (Unix) Vers. 9.00L, Copyright Gimpel Software 1985-2014
--- Module: diy.cpp (C++)
     1  //lint -indirect(au-misra-cpp-alt.lnt)
     2  namespace
     3  {
     4    typedef unsigned char ui8;
     5    class cFoo
     6    {
     7    public:
     8      cFoo(void) : arr(), p(&arr[0]){}
     9      ui8* get_p(void){return p;}
    10      const ui8* get_p(void) const{return p;}
    11    private:
    12      ui8 arr[4];
    13      ui8* p;
    14    };
    15  }
    16  
    17  

--- Wrap-up for Module: diy.cpp

Print this item

  Rule 10.3, conversion of constant expression
Posted by: Motozo Mario Ikeda - 19-10-2016, 11:30 PM - Forum: 8.10 The essential type model - Replies (6)

It is hard to understand the reason to add Amplification 2 "The conversion of the constant expression in a switch statement's case label to the promoted type of the controlling expression".

What kind of risks should be eliminated with this?

Thank you,
Mario Ikeda

Print this item

  Rule 2.1 deviation permit?
Posted by: dg1980 - 19-10-2016, 02:15 PM - Forum: 7.2 Compilation and build - Replies (2)

Typically, on embedded systems with a simple RTOS, main is used as background task, so it never returns:

Code:
int main(void)
{
  Setup_Rtos();
  for (;;)
  {
    Background_Task();
  }
  return 0;// Violates MISRA C 2012 2.1: unreachable code
}

Would this be a candidate for your deviation permits document?

Print this item

  MISRA C:2012 and ISO/IEC 9899:2011 (C11)
Posted by: andream - 18-10-2016, 12:08 PM - Forum: 7.1 The implementation - Replies (4)

MISRA C:2012 has made reference to ISO/IEC 9899:1999 (C99). As of 2011, there is the latest ISO/IEC 9899:2011 (C11). I wonder if any Supplement, Amendment or slight change has been prepared in this respect. Or MISRA C:2012 is invariant w.r.t said latest ISO standard?

Print this item

  Note 9003: could define variable at block scope
Posted by: PeterW - 12-10-2016, 08:39 AM - Forum: 8.9 Initialization - Replies (2)

Hi,
In my code I have a static const array which is declared outside the block scope of the function where it’s used. Also it is only used by one function, so the Note 9003 is correct.
But the array is large and will ruin the overview of the function. So I want to suppress the warning using /*lint -e9003*/ before the array and /*lint +e9003*/ behind it.
But this has no effect. As I suppress the warning global it works, but this shall not be the way to do.
Any idea how to suppress the warning local for just one variable?

Print this item

  Mixed C/C++ build environment
Posted by: dg1980 - 11-10-2016, 11:40 AM - Forum: C++ General - No Replies

Could you write an explicit chapter on how to deal with this situation in the next version of the standard?
For example, i don't think this is what MISRA intended: http://support.gimpel.com/forums/225702-...th-mixed-c
Also, consider adding exceptions to some rules in the context of headers being included in both C and C++ modules:

Code:
#ifndef FOO_H
#define FOO_H

#define MAGIC_CONSTANT 123456/*Violates MISRA C++ Rule 16-2-2, but is fine in C and changing would require storage in C (effiency)*/
typedef int int32_t;

#ifdef __cplusplus
extern "C"
{
#endif

int32_t foo_api(void);

#ifdef __cplusplus
}
#endif

#endif

Thank you very much.

Print this item

  MISRA C:2012 has no explicit library-specific restriction on <stdarg.h>?
Posted by: bycho - 11-10-2016, 09:26 AM - Forum: 7.1 The implementation - Replies (1)

A presentation slide from Andrew Banks, Chairman of MISRA C Working Group, says
that MISRA C:2012 has no explicit library-specific restriction on 7 standard headers and among these is included.
(page 13, http://www.open-std.org/jtc1/sc22/wg14/w.../n2035.pdf)
so I thought I would be able to check whether a program is a conforming freestanding program or not by applying MISRA C:2012 guidelines.

However, in MISRA C:2012 Rule 17.1 says the features of shall not be used.

I think some rules of MISRA C:2012 are too restrictive to use in various kinds of industries.
Moreover, it makes me unhappy that complying with MISRA C:2012 doesn't imply conforming freestanding implementation.

is the slide wrong? or is there any mistake in my mind?
I'm beginner in MISRA guidelines, so I might have lots of errors.
I will appreciate your advices and help.

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,171
» Latest member: stephanmuench
» Forum threads: 998
» Forum posts: 2,752

Full Statistics

Online Users
There are currently 384 online users.
» 0 Member(s) | 381 Guest(s)
Applebot, Bing, Google

Latest Threads
Rule 6.2.1: non-inline co...
Forum: 4.6 Basic concepts
Last Post: cgpzs
22-11-2024, 10:11 AM
» Replies: 0
» Views: 22
Rule 0.1.2
Forum: 4.0 Language independent issues
Last Post: stephanmuench
21-11-2024, 01:12 PM
» Replies: 0
» Views: 33
A18-9-4
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
23-10-2024, 12:04 PM
» Replies: 2
» Views: 360
A8-4-5: are partial moves...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
22-10-2024, 02:03 PM
» Replies: 1
» Views: 319
model information blocks ...
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
22-10-2024, 01:27 PM
» Replies: 1
» Views: 4,439
MISRA AL SLSF - Rule 043I
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
22-10-2024, 01:11 PM
» Replies: 1
» Views: 8,858
MISRA AC EC guidelines
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 08:21 AM
» Replies: 4
» Views: 15,496
News on future releases
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 08:05 AM
» Replies: 1
» Views: 5,689
Signal naming convention ...
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 07:57 AM
» Replies: 1
» Views: 7,244
Rule 7.0.2: operator cons...
Forum: 4.7 Standard conversions
Last Post: karos
14-10-2024, 08:52 PM
» Replies: 2
» Views: 428