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

Username
  

Password
  





  Rule 2.2 - dead code
Posted by: delta_controls - 25-07-2016, 01:16 PM - Forum: 8.2 Unused code - Replies (4)

Does the following code example violate Rule 2.2, due to the left shift?

[code]#define BITSET(reg, bit) ((reg) |= (uint8_t)(1u

Print this item

  MISRA-2012 = state of the art?
Posted by: aaapppbbb - 20-07-2016, 05:08 AM - Forum: MISRA C:2004 to MISRA C:2012 migration - Replies (1)

Hello all,

We use MISRA-2004. Do you need to migrate to MISRA-2012? Is MISRA-2012 state of the art?

Any recommendations? Official statements? Decision matrix?

Greetings
Adam

Print this item

  11.0.1 and static data members
Posted by: grunwald - 08-07-2016, 03:46 PM - Forum: 6.11 Member access control (C++) - Replies (1)

Does 11.0.1 "Member data in non-POD class types shall be private." apply to all data members, or only non-static data members?

In particular, I'm interested whether the constant in this code violates 11.0.1:

Code:
class MyClass {
    std::string non_pod_class;
public:
    static const int CONSTANT = 10;
};

const int MyClass::CONSTANT;

Print this item

  Quick links menu and logout button not showing/working anymore
Posted by: dg1980 - 05-07-2016, 06:07 AM - Forum: General Questions - Replies (5)

Is it just me or is anybody else having trouble too (tested with IE 11 and Firefox 47)?

Print this item

  declaration or definition
Posted by: Motozo Mario Ikeda - 23-06-2016, 12:38 AM - Forum: 8.2 Unused code - Replies (2)

Rule 2.3 mentions "type declaration".
Rule 2.5 mentions "macro declaration".

But I think the type should not be declared but defined by "typedef".
I also think the macro should not be decalred but defined by "#define".

MISRA Study Group in Japan is confused when translating the guidelines.

Thank you

Print this item

  Does "u8 = 6L;" violate rule 10.3
Posted by: misra-c - 17-06-2016, 01:11 PM - Forum: 8.10 The essential type model - Replies (3)

The following question has been submitted to the working group.

Please can you explain which of the following are non-compliant with rule 10.3.

Code:
typedef signed char sint8_t;
typedef unsigned char uint8_t;
sint8_t s8;
uint8_t u8;
s8 = 6L;      /* not compliant - STLR is essentially signed long */
u8 = 6UL;     /* not compliant - as above */

u8 = 6;       /* compliant by exception 1 */
u8 = 6L;      /* compliant or not ? */
Exception 1 says that
Quote:a non-negative integer constant expression of essentially signed type may be assigned to an object of essentially unsigned type if its value can be represented in that type
The value of 6L can be represented in an unsigned char type and so this implies that the above assignment is compliant by exception 1. However this is not consistent with u8 = 6UL being non-compliant.

Print this item

  Rule 4-5-1 prohibits sizeof(bool_type_variable)?
Posted by: udi - 13-06-2016, 04:56 AM - Forum: 6.4 Standard conversions (C++) - Replies (3)

According to Rule 4-5-1 sizeof(bool_type_variable) is not allowed, although it is very meaningful in serialization.
Is this intentional?
If so then why?

Print this item

  Rule 12.5 - sized and unsized array parameters
Posted by: rgamble - 11-06-2016, 12:23 AM - Forum: 8.12 Expressions - Replies (1)

Does Rule 12.5 from AMD-1 apply to unsized array parameters (those without a size between the brackets)? E.g.:

Code:
void f(int32_t A[4], int32_t B[]) {
    uint32_t sizeA = sizeof(A);  // Obvious violation of 12.5
    uint32_t sizeB = sizeof(B);  // Violation of 12.5?
}

The snippets in the amplification, rationale, and examples exclusively use sized arrays and the rationale does not seem to apply as strongly to unsized array parameters but the rule does not specify that it only applies to sized arrays or to both sized and unsized arrays. Can you please clarify the intention here?

Print this item

  MISRA Guidelines for secure coding now available
Posted by: david ward - 25-05-2016, 03:59 PM - Forum: Announcements - No Replies

MISRA has published a mapping of MISRA C coverage of the "C Secure" requirements found in ISO/IEC TS 17961:2013. This mapping shows that for freestanding applications, MISRA C already has excellent coverage of the "C Secure" requirements. Additional guidelines are provided in MISRA C:2012 Amendment 1 to improve the coverage of the security concerns highlighted by the "C Secure" guidelines.

Both documents are available as free downloads from the "Resources" section of this Bulletin Board.

If you have questions on the new Guidelines then they can be asked under the relevant forum topic (e.g. a question about Rule 12.5 should be added under "MISRA C > MISRA C:2012 guidelines > 8.12 Expressions").

Print this item

  MISRA Compliance:2016 now available
Posted by: david ward - 25-05-2016, 03:56 PM - Forum: Announcements - Replies (3)

MISRA Compliance:2016 and the associated document MISRA C:2004 Permits are now available as free downloads from the "Resources" section of this Bulletin Board.

MISRA Compliance sets out a framework for claiming compliance with MISRA coding guidelines including guidance on a robust and structured process for the use of deviations. It includes a mechanism for establishing pre-approved "permits" to help streamline the deviation process. It supersedes the compliance, deviation and process requirements previously published in various MISRA coding guidelines.

MISRA C:2004 Permits presents a number of deviation permits covering commonly-encountered use cases for use with the MISRA C:2004 guidelines. It should be used in conjunction with MISRA Compliance:2016, a companion document which describes the purpose of deviation permits and which sets out the principles by which the concept of MISRA Compliance is governed.

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,207
» Latest member: MLBstubs
» Forum threads: 1,017
» Forum posts: 2,796

Full Statistics

Online Users
There are currently 187 online users.
» 0 Member(s) | 183 Guest(s)
Bing, Google, UptimeRobot, Yandex

Latest Threads
Rule 7.0.5, example non-c...
Forum: 4.7 Standard conversions
Last Post: cgpzs
17-04-2025, 12:10 PM
» Replies: 0
» Views: 168
A3-3-2 Contradictory exam...
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
31-03-2025, 09:30 AM
» Replies: 2
» Views: 296
16.6.1 clarification
Forum: 4.16 Overloading
Last Post: cgpzs
31-03-2025, 09:29 AM
» Replies: 2
» Views: 277
Rule 9.3.1 - iteration st...
Forum: 4.9 Statements
Last Post: misra cpp
28-03-2025, 01:17 PM
» Replies: 1
» Views: 187
Rule 8.2.8 - why aren't a...
Forum: 4.8 Expressions
Last Post: misra cpp
28-03-2025, 01:05 PM
» Replies: 1
» Views: 208
Typo in Appendix C of MIS...
Forum: 8.10 The essential type model
Last Post: Yordan Naydenov
17-03-2025, 02:58 PM
» Replies: 0
» Views: 164
Adopted modal expressions...
Forum: General Questions
Last Post: Yordan Naydenov
17-03-2025, 09:01 AM
» Replies: 0
» Views: 258
Roadmap to c23 support
Forum: General Questions
Last Post: ACHart
28-02-2025, 03:23 PM
» Replies: 0
» Views: 211
Rule 6.2.1 weak linkage
Forum: 4.6 Basic concepts
Last Post: misra cpp
28-02-2025, 01:04 PM
» Replies: 1
» Views: 267
A8-4-5: Should have an ex...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
21-02-2025, 12:58 PM
» Replies: 3
» Views: 694