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,171
» Latest member: stephanmuench
» Forum threads: 998
» Forum posts: 2,752

Full Statistics

Online Users
There are currently 302 online users.
» 0 Member(s) | 300 Guest(s)
Bing, Google

Latest Threads
Rule 6.2.1: non-inline co...
Forum: 4.6 Basic concepts
Last Post: cgpzs
22-11-2024, 10:11 AM
» Replies: 0
» Views: 35
Rule 0.1.2
Forum: 4.0 Language independent issues
Last Post: stephanmuench
21-11-2024, 01:12 PM
» Replies: 0
» Views: 44
A18-9-4
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
23-10-2024, 12:04 PM
» Replies: 2
» Views: 394
A8-4-5: are partial moves...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
22-10-2024, 02:03 PM
» Replies: 1
» Views: 336
model information blocks ...
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
22-10-2024, 01:27 PM
» Replies: 1
» Views: 4,459
MISRA AL SLSF - Rule 043I
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
22-10-2024, 01:11 PM
» Replies: 1
» Views: 8,875
MISRA AC EC guidelines
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 08:21 AM
» Replies: 4
» Views: 15,522
News on future releases
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 08:05 AM
» Replies: 1
» Views: 5,706
Signal naming convention ...
Forum: MISRA AC SLSF discussions
Last Post: misra-ac
21-10-2024, 07:57 AM
» Replies: 1
» Views: 7,258
Rule 7.0.2: operator cons...
Forum: 4.7 Standard conversions
Last Post: karos
14-10-2024, 08:52 PM
» Replies: 2
» Views: 448