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

Username
  

Password
  





  Should #17-0-2 include any non-function identifier?
Posted by: gs - 16-03-2010, 02:11 PM - Forum: 6.17 Library introduction (C++) - Replies (1)

A discussion of a similar rule for MISRA C concluded the rule was meant to encompass any reserved identifier. While MISRA C++ has excluded functions from this rule and placed their consideration under rule #17-0-3, no mention of standard types (e.g, clock_t) or any other non-function identifier is made as far as I can tell. Should the rule include these also?

Print this item

  8.7 if applied to C++
Posted by: gs - 15-03-2010, 06:25 PM - Forum: 6.8 Declarations and Definitions - Replies (2)

Suppose one wanted to ensure one's C++ code complied with the MISRA C guidelines. Would a static data member of a struct or class be permitted to be accessed by only one function or should that static member be defined at block scope? Suppose the struct/class type were a local one? Would moving the definition of the static member out of the class and directly into block scope provide any benefit?

Print this item

  compiler library files
Posted by: mshearer123 - 12-03-2010, 10:31 AM - Forum: General Questions - Replies (2)

Hi,
I am currently working on a Blackfin project, developing in VISUAL DSP++

I would like to bring this to MISRA, however if i use "include" files such as stdio.h or ccblkfn.h do they comply with MISRA?

I have tried to bring any include files into my local workspace so that logiscope can run through them aswell, this results in hundreds of violations from the files.

Can I claim MISRA compliance with these files? or is there an alternative route i.e. buying MISRA compliant librarys?

Thanks for any advice,

Matthew

Print this item

  Rule 19.15 #include ssyntax, bad name
Posted by: mshearer123 - 02-03-2010, 03:54 PM - Forum: 6.19 Preprocessing Directives - Replies (4)

Hi,

My header files all include #ifndef / #define 's to stop them being included twice, however apparently the name is bad.

i have things like
#ifndef __DMA_h
#define __DMA_h
#endif


and

#ifndef __flash_h
#define __flash_h
#endif

Also changing to the following gives the same error

#ifndef flash_h
#define flash_h
#endif

any help would be great,

Matt

Print this item

  Rule 3.4: All uses of the #pragma directive shall be...
Posted by: mshearer123 - 02-03-2010, 11:32 AM - Forum: 6.3 Documentation - Replies (3)

Hi,
What exactly does this rule mean?
How do i document a #pragma?

thanks,

Matt

Print this item

  Rule 10.1 (DSP code)
Posted by: mshearer123 - 01-03-2010, 02:06 PM - Forum: 6.10 Arithmetic Type Conversions - Replies (2)

Hi,

My code for running a blackfin DSP uses pointers to registers to set specific register values.

i.e.

Code:
*pSPI_FLG = 0x01;

however this generates a MISRA compliancy error.

what other way round this is there?

thanks for any help


matt

Print this item

  8.7 wording?
Posted by: gs - 25-02-2010, 07:47 PM - Forum: 6.8 Declarations and Definitions - Replies (4)

Am I correct in presuming "Objects shall be defined at block scope if they are only accessed from within a single function," should read declared instead of defined?

Print this item

  Exemplar suite for C++
Posted by: azukich - 19-02-2010, 03:20 PM - Forum: C++ General - Replies (2)

Is there an exemplar suite for C++? If not is this in the plans to create this?

Thank you

Print this item

  Booleans and the unterlying type
Posted by: gunter.blache - 15-02-2010, 10:34 AM - Forum: 6.10 Arithmetic Type Conversions - Replies (6)

There are no boolean types in C and I assume that rule 10.x also apply to boolean expressions. The question now is how to make
boolean expressions compliant to these rules.
If there are variables boolU8 and boolS8 which are of type unsigned char and signed char are represent boolean values, and assignment
will require an explicit cast:
boolU8 = (uint8)boolS8;
No problem here.

Boolean operators &&, || and ! yield a result of type "int" (MISRA-C:2004 page 37 3rd paragraph), which confuses me a little bit,
because I expected the guideline to specify an "underlying type" instead of a real type.
So to have a simple assignment like
boolU8 = c && d;
compliant, I have to downcast to the result to uint8, which requires a temporary variable (according to rule 10.3):
int _t = c && d;
boolU8 = (uint8)_t;

The is no more safe than the simple assignment, a lot less readable and involves the plain type "int", which violates rule 6.3 (typedefs
should be used in place of the basic types).

I did not find anything on this subject in the technical corrigendum, nor does the entry in the glossary on "boolean expressions" help
with type casting.

Any thoughts ?

Print this item

  Improving Software Safety through MISRA
Posted by: ybenezra - 04-02-2010, 09:31 AM - Forum: General Questions - Replies (1)

I need to provide an objective evidence showing that Software safety is improved by compliance to MISRA-C rules. The provided evidence should include quantitative measurements that show safety improvement after the application of MISRA-C rules. Please help.

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 150 online users.
» 0 Member(s) | 146 Guest(s)
Bing, Facebook, 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: 536