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

Username
  

Password
  





  6.2 With Respect to Arrays and Pointers?
Posted by: gs - 29-07-2010, 03:23 PM - Forum: 6.6 Types - Replies (1)

Is the following code permitted or prohibited by rule 6.2?

Code:
signed char a[10] = {"123456789"};
signed char *b = "123456789";

Print this item

  Rule 5-3-1 and bool & ...
Posted by: gs - 28-07-2010, 06:03 PM - Forum: 6.5 Expressions (C++) - Replies (2)

Are references to bools permitted under requirement #5-3-1?

Print this item

  Pointer to function conversions (11.1)
Posted by: pkruk - 28-07-2010, 10:46 AM - Forum: 6.11 Pointer Type Conversions - Replies (3)

Hello,

rule 11.1 disallows conversions between function pointers and any other type than integral type.

1. conversion between compatible function types - are they allowed? For example:

Code:
typedef struct S1 { int x; } TS1;
struct S1 (*f1)();
TS1 (*f2)();
f1 = f2; // Is this compliant?


2. what about following case?
Code:
enum STYPE_LIST {
        TYPEA,
    };

    typedef int (*func_t)(char *);
    typedef STYPE_LIST (*func_t2)(char *);

    void moo() {
        func_t p;
        func_t2 p2;
        p= (func_t)p2;  // Is this compliant? Enum vs int
    }

Print this item

  Notion of unused parameter in 0-1-11 and 0-1-12
Posted by: roberto - 25-07-2010, 02:58 PM - Forum: 6.0 Language independent issues (C++) - Replies (1)

Suppose `a' is a parameter. Does `sizeof(a)' count as a use of `a' for the purpose of compliance to 0-1-11 and 0-1-12?

Print this item

  Example for rule 10.1
Posted by: raghaw_k - 21-07-2010, 07:37 AM - Forum: MISRA-C:2004 Exemplar Suite - Replies (1)

as per the misra-c writtent in one of its reply that -
Rules 10.1 and 10.3 were designed with signed and unsigned expressions in mind. The treatment of enums, bitfields, chars, relational operators ( < , , >= ), logical operators ( &&, || ) and equality operators ( ==, != ) do not fit this model as yet.

But in Exempler test file mc2_1001.c line number 221
if ( u16r == 1 ) /* Not Compliant */

So if == operator do not fit in the 10.1 model then Why this line is Not Cpmpliant?

Print this item

  Joint MISRA/SCSC event 24-25 November 2010
Posted by: david ward - 16-07-2010, 01:49 PM - Forum: Announcements - No Replies

We are very pleased to announce that a tutorial and seminar in collaboration with the Safety-Critical Systems Club (SCSC) will be held on 24 and 25 November 2010 in London, UK. On the first day there will be two half-day tutorials, on the MISRA C and MISRA C++ guidelines for the use of these languages in critical systems. The second day will be a seminar that will consider how the MISRA guidelines support safety-related systems development in various industry sectors, and we are particularly keen to feature presentations of case studies. If you would like to speak at this seminar, please discuss your idea with me in the first instance.

Further details of the programme will be available in due course.

There will also be a small exhibition on the second day. Details of the exhibition are available from Joan Atkinson at the SCSC

Print this item

  Joint MISRA/SCSC event 24-25 November 2010
Posted by: david ward - 14-07-2010, 02:09 PM - Forum: C++ Announcements - No Replies

We are very pleased to announce that a tutorial and seminar in collaboration with the Safety-Critical Systems Club (SCSC) will be held on 24 and 25 November 2010 in London, UK. On the first day there will be two half-day tutorials, on the MISRA C and MISRA C++ guidelines for the use of these languages in critical systems. The second day will be a seminar that will consider how the MISRA guidelines support safety-related systems development in various industry sectors, and we are particularly keen to feature presentations of case studies. If you would like to speak at this seminar, please discuss your idea with me in the first instance.

Further details of the programme will be available in due course.

There will also be a small exhibition on the second day. Details of the exhibition are available from Joan Atkinson at the SCSC.

Print this item

  Joint MISRA/SCSC event 24-25 November 2010
Posted by: david ward - 14-07-2010, 02:05 PM - Forum: Announcements - No Replies

We are very pleased to announce that a tutorial and seminar in collaboration with the Safety-Critical Systems Club (SCSC) will be held on 24 and 25 November 2010 in London, UK. On the first day there will be two half-day tutorials, on the MISRA C and MISRA C++ guidelines for the use of these languages in critical systems. The second day will be a seminar that will consider how the MISRA guidelines support safety-related systems development in various industry sectors, and we are particularly keen to feature presentations of case studies. If you would like to speak at this seminar, please discuss your idea with me in the first instance.

Further details of the programme will be available in due course.

There will also be a small exhibition on the second day. Details of the exhibition are available from Joan Atkinson at the SCSC.

Print this item

  Rule 13.3 with respect to 0.0
Posted by: gs - 13-07-2010, 04:58 PM - Forum: 6.13 Control Statement Expressions - Replies (4)

Does rule 13.3 permit testing a floating point expression against 0.0?

Code:
void f( float flt )
{
if( flt == 0.0 )
    {}
}

If not, how is this test any different than
Code:
void f( float flt )
{
if( !flt )
    {}
}
?

Or does 13.3 not permit the second example either?

Print this item

  <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

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 89 online users.
» 0 Member(s) | 86 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: 299
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: 179
Adopted modal expressions...
Forum: General Questions
Last Post: Yordan Naydenov
17-03-2025, 09:01 AM
» Replies: 0
» Views: 286
Roadmap to c23 support
Forum: General Questions
Last Post: ACHart
28-02-2025, 03:23 PM
» Replies: 0
» Views: 221
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: 725