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

Username
  

Password
  





  Rule 6.1
Posted by: Akhil - 15-01-2014, 06:48 AM - Forum: 8.6 Types - Replies (1)

In the Amplification for Rule 6.1 :

For C99 : The appropriate types are :

1. either unsigned or signed int.
This refers to unsigned int and signed int only OR any other datatype..?

2. Another explicitly signed or explicitly unsigned integer type that is premitted by the implementation.
What all types does this refer to ? Does this refer to unsigned short OR unsigned short int etc.

Please clarify.

Print this item

  Rule 2.1 has an Exception.
Posted by: ogawa.kiyoshi - 13-01-2014, 12:20 PM - Forum: 8.2 Unused code - Replies (1)

In rule 2.1, Note: "code that has been conditionally excluded by pre-processor directives is not subject to this rule as it is not presented to the later phases of translation.". I think this statement may be "Exception". Do you think so?

Print this item

  Rule 8.4 - How are tentative definitions handled
Posted by: misra-c - 19-12-2013, 08:25 AM - Forum: 8.8 Declarations and defnitions - Replies (3)

Which of the following are compliant with rule 8.4?

Code:
extern int32_t  ext_val0 = 3;

       int32_t  ext_val1 = 3

extern int32_t  extval2;              
       int32_t  extval2 = 3;

       int32_t  ext_val3;                
       int32_t  ext_val3 = 3;

       int32_t  ext_val4;

Print this item

  Dir 4.6 Does "plain char" need to be typedeffed
Posted by: misra-c - 18-12-2013, 02:48 PM - Forum: 7.4 Code design - Replies (1)

Does Directive 4.6 cover the use of the plain “char” type for the storage and handling of character values?
For example

Code:
const char * string = “some data”;  /* compliant or not ? */

Print this item

  Definition of "constant expression"
Posted by: gs - 16-12-2013, 05:15 PM - Forum: 8.12 Expressions - Replies (7)

For rule 12.4, what definition of "constant expression" is used? If the definition is the one from the ISO C standards, that definition does not make it clear the example

Code:
const uint16_t c = 0xffffu;
uint16_t y = c + 1u;
is compliant because a constant variable, if initialized with a constant expression "can be evaluated during translation rather than runtime".

For the record, different compilers appear to take different approaches as to whether or not a const-qualified variable meets the definition of a "constant expression".

Print this item

  Clarification of Rationale for Rule 10.8
Posted by: ogawa.kiyoshi - 12-12-2013, 07:13 AM - Forum: 8.10 The essential type model - Replies (1)

Rule 10.8 Rationale 3rd paragraph,

"On a 16-bit machine the addition will be performed in 16 bits with the
result wrapping modulo-2 before it is cast to 32 bits."

It will be understood that.

"On a 16-bit machine the addition will be performed in 16 bits with the
result wrapping like modulo-2 before it is cast to 32 bits."

or

"On a 16-bit machine the addition will be performed in 16 bits with the
result wrapping modulo-2^16 before it is cast to 32 bits."

Which do you prefere?

Print this item

  Rule 15.3, switch's, and "fallthru"
Posted by: gs - 10-12-2013, 04:59 PM - Forum: 8.15 Control flow - Replies (1)

Rule 15.3 states, "For the purposes of this rule, a switch-clause that does not consist of a compound statement is treated as if it were a block." What if the switch-clause did not end in an unconditional "break;"? While I understand such code would violate other rule(s), the point raised remains: would the following code violate this rule?

Code:
...
switch( a )
{
case 1:
    if( f(a) > 8 )
        goto b;
    doingSomething();
case 2:
    doingSomeOtherThing();
b:
    tada( a );
    break;
default:
    break;
}
...

Print this item

  Dir4.1 Undefined.
Posted by: ogawa.kiyoshi - 30-11-2013, 11:24 AM - Forum: 7.4 Code design - Replies (1)

Dea all. I am a member of MISRA-C Study Group Japan.

There are two question/information.

1.
At Dir4.1 , Undefined C90 and C99 are listed.
I think C99 Undefined 15 is related C90 Undefined 90.
Are there any relation between Dir4.1 and C90 Undefined 90.

2.
The table of Appendix H.1, some differences from Dir4.1 Undefiend C90 and C99 list.
At Appendix H.1
C99 42 and 112 has "Dir4.1" , perhaps, C99 43 and 113.
C99 44, 45,48, 49, and C90 94 have no "Dir4.1".

Best Regards.
[email protected]

Print this item

  MISRA Exemplar Suite
Posted by: MarkTootell - 29-11-2013, 11:18 AM - Forum: General Questions - Replies (3)

Hi

As with the exemplar suite for C:2004 is there, or will there be, an exemplar suite for C++:2008 and C:2012? I am wanting to access the abilities of some of my companies compilers and also third party static analysis tools and would find these very useful.

Thanks

Print this item

  Will Exemplar Suite be updated for 2012?
Posted by: SteveTj - 25-11-2013, 10:27 PM - Forum: MISRA-C:2004 Exemplar Suite - Replies (2)

Will the MISRA-C:2004 Exemplar Suite be updated for MISRA-C:2012?

Thanks!

SteveTj

Print this item

Search Forums

(Advanced Search)

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

Full Statistics

Online Users
There are currently 110 online users.
» 0 Member(s) | 107 Guest(s)
Applebot, Bing, UptimeRobot

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: 178
A3-3-2 Contradictory exam...
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
31-03-2025, 09:30 AM
» Replies: 2
» Views: 309
16.6.1 clarification
Forum: 4.16 Overloading
Last Post: cgpzs
31-03-2025, 09:29 AM
» Replies: 2
» Views: 293
Rule 9.3.1 - iteration st...
Forum: 4.9 Statements
Last Post: misra cpp
28-03-2025, 01:17 PM
» Replies: 1
» Views: 194
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: 214
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: 175
Adopted modal expressions...
Forum: General Questions
Last Post: Yordan Naydenov
17-03-2025, 09:01 AM
» Replies: 0
» Views: 276
Roadmap to c23 support
Forum: General Questions
Last Post: ACHart
28-02-2025, 03:23 PM
» Replies: 0
» Views: 219
Rule 6.2.1 weak linkage
Forum: 4.6 Basic concepts
Last Post: misra cpp
28-02-2025, 01:04 PM
» Replies: 1
» Views: 273
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: 702