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

Username
  

Password
  





  Rule 1.3 - What do people do to check this rule?
Posted by: delta_controls - 23-08-2016, 02:04 PM - Forum: 8.1 A standard C environment - Replies (13)

Hi,

Of the 191 undefined behaviours listed in C99, there are 61 that have no associated MISRA guideline. Checking all of these is particularly labourious, especially as the list in Annex J is not numbered.

How do people go about checking conformity with this catch-all rule?

Does anyone globally deviate from this rule, since the most important and most likely behaviours are addressed by other guidelines and checking the others is not practical?

Thanks.

Print this item

  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

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 421 online users.
» 0 Member(s) | 418 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: 23
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: 320
model information blocks ...
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
22-10-2024, 01:27 PM
» Replies: 1
» Views: 4,440
MISRA AL SLSF - Rule 043I
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
22-10-2024, 01:11 PM
» Replies: 1
» Views: 8,860
MISRA AC EC guidelines
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 08:21 AM
» Replies: 4
» Views: 15,497
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: 429