CERT C EXP35-C considered Out of Scope by MISRA C:2012 Addendum 3

Questions and discussions about MISRA C not fitting under migration or rules forums

Moderators: misra-c, david ward

Post Reply
jlerch
Posts: 3
Joined: Thu Jul 06, 2017 6:36 am
Company: Continental Teves AG & Co. oHG

CERT C EXP35-C considered Out of Scope by MISRA C:2012 Addendum 3

Post by jlerch » Fri Apr 06, 2018 8:45 am

MISRA C:2012 Addendum 3 defines the coverage classification "Out of Scope" as "Aspects of behaviour are out of scope for C99 and are related to C11." Considering this definition, why is EXP35-C classified "Out of Scope"? The very first example I see in EXP35-C (section 4.5.1 in CERT C 2016 edition) is a non-compliant example for C99. CERT C actually states that the example would work fine in C11, but fails in C99.

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

Re: CERT C EXP35-C considered Out of Scope by MISRA C:2012 Addendum 3

Post by misra-c » Tue Apr 24, 2018 10:28 am

The headline for EXP35-C is "Do not modify objects with temporary lifetime", where "temporary lifetime" is a new term introduced in C11.

However, you are correct that the examples for EXP35-C show that the rule is intended to cover similar undefined behaviour in C99. The coverage should be mapped to Rule 1.3 with a classification of Implicit/Weak.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “General Questions”