Rule 15.0 - Required or Adviosry?

6.15 Switch Statements

Moderators: misra-c, david ward

Post Reply
William Forbes
Posts: 29
Joined: Wed Dec 17, 2008 9:48 pm
Company: TRW Automotive

Rule 15.0 - Required or Adviosry?

Post by William Forbes » Sat Oct 24, 2009 7:32 pm

TC1 introduced the concept of rule 15.0.
However it does not explicitly state if this rule is "Required" or "Advisory"
Is rule 15.0 "required" or "advisory"?

jbezem
Posts: 20
Joined: Mon Aug 01, 2005 8:24 pm
Company: JB Enterprises
Location: Germany
Contact:

Re: Rule 15.0 - Required or Adviosry?

Post by jbezem » Tue Oct 27, 2009 6:53 am

IMHO, specifying the preamble text as rule "15.0" is somewhat confusing. I would suggest to change its wording to clearly identify the preamble to be a rule.
At the same time, the wording is clear: "... the syntax for switch statements as defined by MISRA-C and is normative". To me this means that 15.0 is required, possibly even stronger than normal 'required' rules. In my own responsibility, I would not allow deviations from rule 15.0, not even when commented heavily or using a genarlly accepted deviation procedure.
If such a deviation seems necessary, other contsructs (like chained if ... else if ... else) might be better suited for the occasion.

Best regards,

Johan
Johan Bezem
Email: [email protected]
Tel: +49 172 5463210
Web: http://www.bezem.de/

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

Re: Rule 15.0 - Required or Adviosry?

Post by misra-c » Tue Nov 10, 2009 12:37 pm

Rule 15.0 is required although this is not explicitly stated in TC1. Note that edition 2 of the MISRA-C:2004 Guidelines, which incorporates TC1, is explicit that the rule is required.
---
Posted by and on behalf of
the MISRA C Working Group

jbezem
Posts: 20
Joined: Mon Aug 01, 2005 8:24 pm
Company: JB Enterprises
Location: Germany
Contact:

Re: Rule 15.0 - Required or Adviosry?

Post by jbezem » Tue Nov 10, 2009 2:34 pm

Clarification required, please:
Does this mean that edition 2 is more than the sum of edition 1 + TC1? So if I bought ed.1 and downloaded TC1, I still have less than ed.2?
Is an overview of the additional changes available separately?

TIA,

Johan Bezem
Johan Bezem
Email: [email protected]
Tel: +49 172 5463210
Web: http://www.bezem.de/

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

Re: Rule 15.0 - Required or Adviosry?

Post by misra-c » Fri Nov 20, 2009 12:25 pm

TC1 made all "supporting text" normative. The introductory text to Rules 15.x was made into Rule 15.0 in TC1. When the reprint of MISRA C2, and the corresponding PDF version, were prepared the text was more closely integrated including giving Rule 15.0 a title "The MISRA C switch syntax shall be used".

While there may be some minor editorial differences between edition 1 + TC1 and edition 2, the content is essentially the same.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.15 Switch Statements”