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

Username
  

Password
  





  How to add a MISRA supporting product to Useful links page
Posted by: fasoo - 22-11-2017, 12:37 AM - Forum: General Questions - Replies (1)

I have a question on adding a MISRA C and MISRA C++ supporting tool to the "Useful Links" page on https://www.misra.org.uk/Links/tabid/63/Default.aspx

Please guide me how I can request addition to the page.

Thank you and have a splendid day.

Best

Ray

Print this item

  Rule 20.8 and #elif
Posted by: rgamble - 01-11-2017, 04:03 PM - Forum: 8.20 Preprocessing directives - Replies (1)

It is pretty clear from the Amplification that this is not a violation of Rule 20.8:

Code:
#if 0
  #if 10  /* not evaluated, not a violation */
  #endif
#endif
and that this is:
Code:
#if 0
#elif 20  /* evaluated, violation */
#endif
but is the following intended to be a violation of this rule?:
Code:
#if 1
#elif 20  /* ??? */
#endif
It is not clear if the preprocessing directive #elif 20 is evaluated for the purpose of this rule.

Print this item

  Rule 18.8 and clarification of "use" of VLA types
Posted by: rgamble - 27-10-2017, 04:23 PM - Forum: 8.18 Pointers and arrays - Replies (1)

What exactly is meant by the "use" of "variable-length array types"? The examples suggest that the mere declaration of an object of variable length array type violates this rule which makes sense if the declaration is thought of as "using" the VLA type.

The example below declares a pointer to a VLA type and then dereferences the pointer:

Code:
typedef unsigned uint32_t;
typedef int int32_t;

void foo(uint32_t sz, int32_t (*ary)[sz], int32_t val) {
    (*ary)[0] = val;
}

Is the declaration of the pointer parameter ary a violation of this rule? Is the statement that dereferences ary a violation of this rule?

Print this item

  Is MISRA C:2004 Permits applicable for MISRA C :2012 also
Posted by: Jayaram - 24-10-2017, 04:07 AM - Forum: MISRA Compliance discussions - Replies (1)

Hi,
Could you please confirm whether the "MISRA C:2004 Permits " is applicable for " MISRA C :2012" also.
Thanks,
Jayaram

Print this item

  MISRA switch staement
Posted by: Hanumanthappa E - 18-10-2017, 09:20 AM - Forum: 8.16 Switch statements - Replies (2)

Hi everyone,
Can anyone give an example of MISRA-C "switch" statement pls....

Print this item

  Rule 15.7 and empty else statements without "else if"
Posted by: rgamble - 17-10-2017, 01:36 PM - Forum: 8.15 Control flow - Replies (1)

MISRA C 2012 Rule 15.7 states in the amplification that "The else statement shall contain at least either one side effect or a
comment." Does "The else statement" refers to any else statement or just the final else statement that is required
by the rule when there are one or more "else if" statements? Is the following example a violation of Rule 15.7 because the else
statement does not contain a side effect or comment or is it compliant because the else is not required by the rule?

Code:
typedef _Bool bool_t;
void foo(bool_t x);
void foo(bool_t x) {
    if (x) {
        ;
    }  
    else { }
}

Print this item

  Guidelines for NOT embedded SW?
Posted by: andream - 17-10-2017, 01:13 PM - Forum: General Questions - Replies (4)

I wonder if it has ever been specified a sort of equivalent MISRA C standard, always for safety-critical systems, but not embedded SW, rather running on host. For instance, Plant Monitoring and Air Traffic Management.

Print this item

  misra 2012
Posted by: Hanumanthappa E - 13-10-2017, 12:53 PM - Forum: General Questions - Replies (3)

Hi all,
Where and how can download MISRA 2012 guidelines? Please....

Print this item

  Dir 4.6 and usage of "fast" types in stdint.h
Posted by: michael.metivier - 12-10-2017, 08:31 PM - Forum: 7.4 Code design - Replies (1)

Directive 4.6 indicates "typedefs that indicate sign and signedness should be used in place of the basic numerical types" and suggests that, for C99-compliant systems, the types of should be used.

stdint.h also defines "fast" types which are at least of the indicated length, but may be larger if such a length could be handled more efficiently by the processor.

Is it a violation of Directive 4.6 to utilize these types? They are not "basic numerical types", but also do not necessarily adhere to a fixed length as specified by their names.

Print this item

  Underlying type balancing for integral operands
Posted by: abgs - 06-10-2017, 03:21 PM - Forum: 6.5 Expressions (C++) - Replies (3)

From "Underlying type balancing" on page 57:

Quote:Otherwise, if both operands have integral type, the underlying type of the expression can be found using the following:
– If the types of the operands are the same size, and either is unsigned, the result is unsigned.
– Otherwise, the type of the result is that of the larger type.

1. Does "the types of the operands" refer to underlying type or actual type?

2. Does "and either is unsigned" mean "and either is an unsigned integral type" or "and either is the type unsigned [int]"?

3. What is the intended meaning of "the result is unsigned" in the first bullet? A literal reading might suggest that the result is simply unsigned, i.e. the type unsigned int. I do not think this is the intended behavior. I assume it was meant to have the effect as if it said "the result is the [underlying?] type of the unsigned operand(s)".

4. Does "that of the larger type" refer to underlying type or actual type?

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 163 online users.
» 0 Member(s) | 160 Guest(s)
Bing, Google, 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: 162
A3-3-2 Contradictory exam...
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
31-03-2025, 09:30 AM
» Replies: 2
» Views: 291
16.6.1 clarification
Forum: 4.16 Overloading
Last Post: cgpzs
31-03-2025, 09:29 AM
» Replies: 2
» Views: 275
Rule 9.3.1 - iteration st...
Forum: 4.9 Statements
Last Post: misra cpp
28-03-2025, 01:17 PM
» Replies: 1
» Views: 183
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: 203
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: 160
Adopted modal expressions...
Forum: General Questions
Last Post: Yordan Naydenov
17-03-2025, 09:01 AM
» Replies: 0
» Views: 250
Roadmap to c23 support
Forum: General Questions
Last Post: ACHart
28-02-2025, 03:23 PM
» Replies: 0
» Views: 207
Rule 6.2.1 weak linkage
Forum: 4.6 Basic concepts
Last Post: misra cpp
28-02-2025, 01:04 PM
» Replies: 1
» Views: 263
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: 679