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

Username
  

Password
  





  Rule 16.5
Posted by: hanthen - 02-08-2011, 12:11 PM - Forum: 6.16 Functions - Replies (1)

Does this rule apply also to function pointers?
If I want to declare a function pointer which can be used for pointers to functions with different arguments, something like the following is useful:

uint8_t (* gen_u8p)();

Is this intended to be prohibited by the rule?

Print this item

  Inlcude rule 19.11
Posted by: ggentile - 01-08-2011, 04:55 PM - Forum: MISRA AC AGC discussions - Replies (1)

Rule 19.11
Double include protection. This rule is still OBL also for AC. May you provide some more detail on the rationale behind the necessity for this rules ?

best regards
Giacomo

Print this item

  Rule 043I
Posted by: Ale_mm - 13-07-2011, 06:50 AM - Forum: MISRA AC SLSF discussions - Replies (2)

Hello,

I've a doubt regarding the rule 043I of SLSF set. The rule tells: "In all flow-charts and graphical functions, exactly one unconditional transition must begin at every junction (except for the last junction). Every decision point (junction) must have a default path."
The problem is about the bounds of this rules, because it'd delimited only for flow-charts. Since a flowchart contains none or one state, the rule is not applied in case that I have a junction, without a default path, between two state.
Therefore my question is, why this rule (and as far as I know, no others) does not check default paths in junctions between states? Or else, why this rule is only flowcharts circumscribed and not statecharts as well?


Many thanks in advance,
any feedback will be really appreciated,

Alessandro

Print this item

  MISRA AL SLSF - Rule 043I
Posted by: Ale_mm - 27-06-2011, 07:38 AM - Forum: MISRA AC SLSF discussions - Replies (1)

Hello,

I've a doubt regarding the rule 043I of SLSF set. The rule tells: "In all flow-charts and graphical functions, exactly one unconditional transition must begin at every junction (except for the last junction). Every decision point (junction) must have a default path."
The problem is about the bounds of this rules, because it'd delimited only for flow-charts. Since a flowchart contains none or one state, the rule is not applied in case that I have a junction, without a default path, between two state.
Therefore my question is, why this rule (and as far as I know, no others) does not check default paths in junctions between states? Or else, why this rule is only flowcharts circumscribed and not statecharts as well?


Many thanks in advance,
any feedback will be really appreciated,

Alessandro

Print this item

  Rule #8.7 for "special function registers" and others?
Posted by: gs - 15-06-2011, 07:39 PM - Forum: 6.8 Declarations and Definitions - Replies (3)

Does this rule apply to objects which cannot be declared at block scope, like special function register variables?

Print this item

  if-statement with two checks with different data types
Posted by: MaWu - 07-06-2011, 08:02 AM - Forum: 6.10 Arithmetic Type Conversions - Replies (7)

Hi everyone!

I have a question about rule 10.1 and 10.2
Whenever I try to work with an if or while and use two comparions which are logically connected I get an MISRA issue when the two comparisons have different data types.
e.g. int16 and int32
Because the results of the two comparions is somehow boolean I would not expected to get:
The value of an expression implicitly converted to a different type.

Is it really an issue? I know I can cast both to the same data type but it looks strange.

Example:

Code:
t_int8 a = 3;
t_uint16 b = 7;
  
if ((a > 3) && (b > 5u))
{
   a++;  
}

Print this item

  Is rule 7-5-3 really relevant?
Posted by: triboix - 27-05-2011, 10:24 AM - Forum: 6.7 Declarations (C++) - Replies (1)

Hello,

Is rule 7-5-3 really relevant?

It says that something like

Code:
int& f(int& x)
{
    return x;
}
is not compliant.

But surely all C++ developers on the planet would expect x to be modified here after calling f:
Code:
void f(int& x)
{
    x++;
}

So why returning x directly would be an issue? I guess there is probably something I am not seeing here!

Thanks for any clarification!

Fabrice

Print this item

  Formal Verification of Automotive SW
Posted by: M.K. Srivas - 18-05-2011, 10:21 AM - Forum: MISRA SA discussions - No Replies

Hi:

Does either ISO 26262 or MISRA SA documents provide any guidelines or requirements regarding use of "formal verification techniques" for ensuring correctness of safety-critical automotive SW? ANy benchmarks?

Can I get any references to significant works in applying formal verification techniques to auto-motive SW?

I'd appreciate if you can provide feedback.

Thanks and regards,

Srivas

Print this item

  16.3
Posted by: beckschulze - 15-04-2011, 12:52 PM - Forum: 6.16 Functions - Replies (5)

Just to make sure, does rule 16.3 also apply to declarations of function pointers?

void (*pt2Function)(int);

Sould I give a name to the parameter?
Does that make sense at all?

Print this item

  19.4 - is typedef considered to be a type qualifier?
Posted by: mishak - 14-04-2011, 04:07 PM - Forum: 6.19 Preprocessing Directives - Replies (1)

The C standard states that "The typedef specifier is called a ‘‘storage-class specifier’’ for syntactic convenience only;".

Does 19.4 allow a macro to expand to 'typedef'?

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,208
» Latest member: jablodan
» Forum threads: 1,017
» Forum posts: 2,796

Full Statistics

Online Users
There are currently 105 online users.
» 0 Member(s) | 102 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: 185
A3-3-2 Contradictory exam...
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
31-03-2025, 09:30 AM
» Replies: 2
» Views: 316
16.6.1 clarification
Forum: 4.16 Overloading
Last Post: cgpzs
31-03-2025, 09:29 AM
» Replies: 2
» Views: 297
Rule 9.3.1 - iteration st...
Forum: 4.9 Statements
Last Post: misra cpp
28-03-2025, 01:17 PM
» Replies: 1
» Views: 196
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: 217
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: 178
Adopted modal expressions...
Forum: General Questions
Last Post: Yordan Naydenov
17-03-2025, 09:01 AM
» Replies: 0
» Views: 285
Roadmap to c23 support
Forum: General Questions
Last Post: ACHart
28-02-2025, 03:23 PM
» Replies: 0
» Views: 220
Rule 6.2.1 weak linkage
Forum: 4.6 Basic concepts
Last Post: misra cpp
28-02-2025, 01:04 PM
» Replies: 1
» Views: 279
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: 724