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

Username
  

Password
  





  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

  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

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,309
» Latest member: 1fuhd
» Forum threads: 1,066
» Forum posts: 2,933

Full Statistics

Online Users
There are currently 178 online users.
» 0 Member(s) | 175 Guest(s)
Bing, Google, UptimeRobot

Latest Threads
13.2 Was TC2 correctly ap...
Forum: 8.13 Side effects
Last Post: misra-c
08-10-2026, 12:47 PM
» Replies: 1
» Views: 624
20.12 Does the stringific...
Forum: 8.20 Preprocessing directives
Last Post: misra-c
08-10-2026, 12:40 PM
» Replies: 1
» Views: 554
13.3 Should side effects ...
Forum: 8.13 Side effects
Last Post: misra-c
08-10-2026, 12:37 PM
» Replies: 1
» Views: 427
11.6 pointer to pointer t...
Forum: 8.11 Pointer type conversions
Last Post: misra-c
08-10-2026, 12:21 PM
» Replies: 2
» Views: 1,032
What is the UTLR of -1?
Forum: 8.10 The essential type model
Last Post: misra-c
08-10-2026, 12:15 PM
» Replies: 1
» Views: 597
10.3 Clarify if narrower ...
Forum: 8.10 The essential type model
Last Post: misra-c
08-10-2026, 11:57 AM
» Replies: 1
» Views: 508
It 8.12 intended to be so...
Forum: 8.8 Declarations and defnitions
Last Post: misra-c
08-10-2026, 11:50 AM
» Replies: 1
» Views: 455
Rule 0.1.1 Example f4
Forum: 4.0 Language independent issues
Last Post: cgpzs
07-10-2026, 11:07 AM
» Replies: 3
» Views: 723
Rule 6-2-2 Usage of std::...
Forum: 6.6 Statements (C++)
Last Post: misra cpp
25-09-2026, 05:43 PM
» Replies: 1
» Views: 436
M5-0-4 switch over unscop...
Forum: 6.5 Expressions (C++)
Last Post: misra cpp
25-09-2026, 01:00 PM
» Replies: 3
» Views: 537