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

Username
  

Password
  





  A8-5-2 + A8-5-3: No usage of auto allowed?
Posted by: chgros - 11-08-2023, 05:36 PM - Forum: AUTOSAR C++:2014 rules - Replies (2)

It appears that it's impossible to use `auto` variables and be compliant with both A8-5-2 (which mandates {} initialization for all variables) and A8-5-3 (which forbids {} initialization for auto variables)
Is that the intention? How is one supposed to use lambdas in that case?

Print this item

  MISRA AC SLSF:2023 released
Posted by: david ward - 09-08-2023, 04:24 PM - Forum: MISRA AC SLSF discussions - No Replies

We are pleased to announce a new version of MISRA AC GMG has been released.

The MISRA Autocode (AC) family of documents deals with the application of language subsets for automatic code generation purposes. This document, MISRA AC SLSF, contains the best practices, captured as a set of design and style guidelines, for the use of The Mathworks® Simulink® and Stateflow® tools for producing models that will be used for simulation and automatic code generation. Updated in June 2023, this second edition is the current version of MISRA AC SLSF. This document supersedes the first edition (published in 2009).

The MISRA webstore provides single-user PDFs and you can purchase a hardcopy via a "print on demand" service at the following link. Please be sure to select the most appropriate “marketplace” for your location to expedite delivery. MISRA AC SLSF:2023 hardcopy

Print this item

  MISRA AC GMG:2023 released
Posted by: david ward - 09-08-2023, 04:23 PM - Forum: MISRA AC GMG discussions - Replies (2)

We are pleased to announce a new version of MISRA AC GMG has been released.

The MISRA Autocode (AC) family of documents deals with the application of language subsets for automatic code generation purposes. This document, MISRA AC GMG, contains the best practices, captured as a set of design and style guidelines, for the use in all graphical modelling environments for producing models that will be used for simulation and automatic code generation. Updated in June 2023, this second edition is the current version of MISRA AC GMG. This document supersedes the first edition (published in 2009).

The MISRA webstore provides single-user PDFs and you can purchase a hardcopy via a "print on demand" service at the following link. Please be sure to select the most appropriate “marketplace” for your location to expedite delivery. MISRA AC GMG:2023 hardcopy

Print this item

  Rule 17.3 when function has definition
Posted by: dunno - 15-06-2023, 02:32 PM - Forum: 8.17 Functions - No Replies

I wonder if the code below violates rule 17.3:

void dostuff(int x) {
    // do some stuff..
}

void func(void) {
    dostuff(12);   // <- is 17.3 violated here?
}

Please note that the functions dostuff and func violates rule 8.4 and don't have prototypes.

Question: is 17.3 violated when calling a function that violates rule 8.4?

The rationale for 17.3 also does not apply to my example code as far as I understand:

    If a function is declared implicitly, a C90 compiler will assume
    that the function has a return type of int. Since an implicit 
    function declaration does not provide a prototype, a compiler will
    have no information about the number of function parameters and
    their types. 

Print this item

  21.18 is a safe strncpy function call non-compliant?
Posted by: dunno - 15-06-2023, 01:06 PM - Forum: 8.21 Standard libraries - No Replies

I have a philosophical question.


Example code:

void foo() {
    char buf[128];
    strncpy(buf, "hello", 128);
}

The strncpy call does not have any undefined behavior. It will write "hello" in the buffer. Writing 6 bytes in a 128 byte buffer is not undefined behavior.

Does this code then violate rule 21.18? The third argument is larger than the size of the string literal.

Reading the amplification, it seems to me the code in non-compliant.

Reading the rationale, the point of this rule is to avoid buffer overflows. Since there is no buffer overflow does it mean the code is compliant?

Print this item

  MISRA Compliance Matrix
Posted by: vartika.tailor - 08-06-2023, 04:57 PM - Forum: General Questions - Replies (2)

Hi,

Please could you let me know whether I can download a template MISRA 2012 compliance matrix document and the link to the document? 

Kind regards,
Vartika

Print this item

  MISRA C:2012 Example Suite
Posted by: misra-c - 18-05-2023, 05:01 PM - Forum: MISRA resources - No Replies

For info, the MISRA C:2012 Example suite is now available via the MISRA Git Repository

https://gitlab.com/MISRA/MISRA-C/MISRA-C...mple-Suite

At the moment, this is read-only

Print this item

  MISRA C:2023 released
Posted by: david ward - 12-05-2023, 04:29 PM - Forum: Announcements - No Replies

We are pleased to announce the release of MISRA C:2023 (MISRA C Third edition, Second revision). This is a further update which incorporates Amendments 2 – 4 (AMD2, AMD3, AMD4) and Technical Corrigendum 2 (TC2) and incorporates support for C11 and C18 language features.

At the present time this document is available in PDF form, but we will provide an option for purchase of hardcopies in around 4 – 6 weeks’ time using a “print on demand” service.

Further information including FAQs is available on the MISRA website.

The current version history of MISRA C, with the newest first, is as follows

  • MISRA C:2023 (Third Edition, Second Revision) – published 2023, the current version incorporating support for C11 and C18 language features
  • MISRA C:2012 (Third Edition, First Revision) – also known as MISRA C:2019, published 2019, incorporated additional security guidelines
  • MISRA C:2012 (Third Edition) – published 2013, incorporated support for C99 language features, improved strong typing model, analysis keywords
  • MISRA C:2004 (Second Edition) – published 2004, taking into account user feedback and cross-industry applications
  • MISRA C:1998 (First Edition) – published 1998, original guidance emerging from the automotive industry.

Print this item

  MISRA C:2012 AMD4 released
Posted by: david ward - 24-03-2023, 12:56 AM - Forum: Announcements - No Replies

MISRA C:2012 Amendment 4 (which completes addition of support for C11/C18 language features) is now available as a free download from the "Resources" section of this Bulletin Board.

Looking to the future we will shortly release a consolidated version (to be known as MISRA C:2023) rolling up the recent amendments and technical corrigenda. We will make a further announcement when this is available for purchase.

Print this item

  MISRA C:2012 AMD4
Posted by: david ward - 15-03-2023, 04:16 PM - Forum: MISRA resources - Replies (2)

We are pleased to announce the publication of MISRA C:2012 Amendment 4 (MISRA C:2012 AMD4). This document completes the additional updates for ISO/IEC 9899:2011/2018 with consideration of new C11/C18 features.

This amendment is intended to be used with MISRA C:2012 (Third Edition, First Revision) as revised and amended by:

  • MISRA C:2012 Technical Corrigendum 2,
  • MISRA C:2012 Amendment 2, and
  • MISRA C:2012 Amendment 3.

This amendment is also compatible with MISRA C:2012 (Third Edition) as revised and amended by:

  • MISRA C:2012 Technical Corrigendum 1,
  • MISRA C:2012 Technical Corrigendum 2,
  • MISRA C:2012 Amendment 1,
  • MISRA C:2012 Amendment 2, and
  • MISRA C:2012 Amendment 3.



Attached Files
.pdf   MISRA C 2012 AMD4.pdf (Size: 1.39 MB / Downloads: 70)
Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,183
» Latest member: davtas
» Forum threads: 1,004
» Forum posts: 2,768

Full Statistics

Online Users
There are currently 206 online users.
» 0 Member(s) | 203 Guest(s)
Bing, DuckDuckGo, Google

Latest Threads
MISRA AC SLSF:2023 AMD3
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
13-01-2025, 10:58 AM
» Replies: 0
» Views: 44
MISRA AC SLSF:2023 AMD3
Forum: MISRA AC resources
Last Post: misra-ac
13-01-2025, 10:57 AM
» Replies: 0
» Views: 41
Rule 7.0.4 - exception fo...
Forum: 4.7 Standard conversions
Last Post: misra cpp
10-01-2025, 02:26 PM
» Replies: 4
» Views: 427
rule 7.0.5: clarification...
Forum: 4.7 Standard conversions
Last Post: misra cpp
10-01-2025, 02:11 PM
» Replies: 1
» Views: 108
Rule 7.0.6 - why the requ...
Forum: 4.7 Standard conversions
Last Post: misra cpp
10-01-2025, 01:24 PM
» Replies: 1
» Views: 65
Rule 6.2.1: non-inline co...
Forum: 4.6 Basic concepts
Last Post: cgpzs
20-12-2024, 02:38 PM
» Replies: 2
» Views: 450
Rule 7.0.2: Unclear/quest...
Forum: 4.7 Standard conversions
Last Post: misra cpp
20-12-2024, 02:24 PM
» Replies: 1
» Views: 326
Rule 0.1.2
Forum: 4.0 Language independent issues
Last Post: misra cpp
20-12-2024, 02:05 PM
» Replies: 1
» Views: 336
A18-9-4
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
23-10-2024, 12:04 PM
» Replies: 2
» Views: 896
A8-4-5: are partial moves...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
22-10-2024, 02:03 PM
» Replies: 1
» Views: 710