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

Username
  

Password
  





  <cstdio> explicitly banned but not <fstream> or <ostream>
Posted by: KCCMITCELL - 07-07-2010, 02:17 PM - Forum: 6.27 Input/output library (C++) - Replies (2)

Rule 27-0-1 specifically bans the use of library for access to the external file system but not . Do we imply from this that is a safer alternative, or is it considered inherently unsafe, in any case, for application code to access the file system at run-time.

This question is asked in the context that the real-time software for our vehicle-based military project may be required to read configuration parameters from file at start-up, and log telemetry data during run-time.

It is also noted that std::cout () is used in the example code for Rule 3.4.1., whereas printf would be banned under Rule 27-0-1.

Print this item

  MISRA SW metrics
Posted by: adytzul_ac - 29-06-2010, 08:32 AM - Forum: General Questions - Replies (1)

Hello.

Are there any code metrics defined by MISRA?

Thanks.

Print this item

  Function returning pointer to array - Rule 17.4
Posted by: Greg Middleton - 24-06-2010, 01:24 PM - Forum: 6.17 Pointers and Arrays - Replies (5)

I have a function returning a pointer to an array, not an uncommon situation I would think.
How can I reference elements in that array without violating Rule 17.4 ?.
1. Indexing is not compliant as the return type is not an array.
2. Pointer arithmetic is not compliant.
So it looks like returning pointers to arrays is effectively banned by this rule, is that the case?.

Print this item

  what means about "Before preprocessing" in Rule[14.3]
Posted by: linglingma - 23-06-2010, 12:33 PM - Forum: 6.14 Control Flow - Replies (3)

"Before preprocessing, a null statement shall only occur on a
line by itself; it may be followed by a comment provided that
the first character following the null statement is a white-space
character." in this rule,why "Before preprocessing"is used as a condition?
Thanks!

Print this item

  about rule20_5
Posted by: Manisha Nikambe - 15-06-2010, 06:38 AM - Forum: 6.20 Standard Libraries - Replies (2)

void func()
{
int errno;//does even declaration of errno violates rule20_5,errno is user defined?
}

Print this item

  Assigning literal 0 to an unsigned variable
Posted by: gs - 11-06-2010, 03:45 PM - Forum: 6.10 Arithmetic Type Conversions - Replies (3)

Should literal 0 be exempt from rule 10.1? True, rule 10.6 requires a 'U' suffix in this case. However, what about in regards to rule 10.1 by itself?

Print this item

  about rule20.5
Posted by: raghaw_k - 25-05-2010, 12:18 PM - Forum: 6.20 Standard Libraries - Replies (8)

According to the rule 20.5, error indiaction facility should not be used even if it is well defined.
1)Is it mean that we should not declare the identifier(function and variable) with the name "errno"?
2)As per the standard library for linux "errno" MACRO is defined to function pointer call and for Visual C++ it is extern variable declaration. So does usage of "errno"(i.e. function call) on linux also violates the rule 20.5?

Print this item

  MISRA usage
Posted by: ggentile - 12-05-2010, 06:23 PM - Forum: General Questions - No Replies

We bought a single license for MISRA C document. We are developping an internal tool to check MISRA rules, is it possible to use the description of each rule in the helper of the tool ?
Or exist any restriction also in the usage of the rules description ?

Giacomo

Print this item

  Was something missed for 12.6 about "?:"?
Posted by: gs - 06-05-2010, 03:25 PM - Forum: 6.12 Expressions - Replies (1)

The wording of advisory #12.6 indicates expressions other than effectively boolean ones are permitted as the conditional argument to "?:". Was this wording an oversight? In three other circumstances, the guidelines insist on effectively boolean expressions and it seems unintuitive to not require such in this case as well.

Print this item

  namelengthmax
Posted by: ggentile - 29-04-2010, 10:29 AM - Forum: MISRA AC SLSF discussions - Replies (3)

I didn't find any limitation in MISAR AC* in the usage of matlab lenght identifier.

Where I am wrong ?

Giacomo

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,196
» Latest member: galibl1
» Forum threads: 1,008
» Forum posts: 2,779

Full Statistics

Online Users
There are currently 261 online users.
» 0 Member(s) | 258 Guest(s)
Applebot, Bing, Google

Latest Threads
A8-4-5: Should have an ex...
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
Yesterday, 02:14 PM
» Replies: 2
» Views: 119
A18-9-4
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
14-02-2025, 01:04 PM
» Replies: 3
» Views: 1,204
Rule 3-4-1 and lifetimes,...
Forum: 6.3 Basic concepts (C++)
Last Post: misra cpp
14-02-2025, 01:02 PM
» Replies: 1
» Views: 87
Application of Rule 15.0....
Forum: 4.15 Special member functions
Last Post: misra cpp
07-02-2025, 12:44 PM
» Replies: 3
» Views: 2,576
Rule 6.2.1: non-inline co...
Forum: 4.6 Basic concepts
Last Post: misra cpp
07-02-2025, 12:43 PM
» Replies: 3
» Views: 739
A7-2-1 Still relevant in ...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
31-01-2025, 01:20 PM
» Replies: 1
» Views: 206
MISRA AC INT:2025
Forum: MISRA AC resources
Last Post: misra-ac
22-01-2025, 03:37 PM
» Replies: 0
» Views: 147
MISRA AC SLSF:2023 AMD3
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
13-01-2025, 10:58 AM
» Replies: 0
» Views: 199
MISRA AC SLSF:2023 AMD3
Forum: MISRA AC resources
Last Post: misra-ac
13-01-2025, 10:57 AM
» Replies: 0
» Views: 193
Rule 7.0.4 - exception fo...
Forum: 4.7 Standard conversions
Last Post: misra cpp
10-01-2025, 02:26 PM
» Replies: 4
» Views: 837