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

Username
  

Password
  





  MISRA Members...
Posted by: Dip - 19-06-2014, 08:45 AM - Forum: General Questions - No Replies

Hello,

Pls. guide on the process and criteria for the "MISRA" membership.

Link: http://www.misra.org.uk/Links/tabid/63/Default.aspx --> Useful links --> MISRA Members

Print this item

  Listing a Tool in the list "Tools supporting MISRA C"
Posted by: Dip - 19-06-2014, 08:40 AM - Forum: General Questions - No Replies

Hello,

Pls. guide on the process and criteria on getting any tool/ parent company listed in the list of "Tools supporting MISRA C..." under Category "Useful links" on "MISRA" website..

Print this item

  11.5: Conversion from point to void
Posted by: michael.metivier - 17-06-2014, 02:19 PM - Forum: 8.11 Pointer type conversions - Replies (3)

According to the Exception to 11.3, it is permissible to convert a pointer to object into pointer to char, signed char, or unsigned char. There doesn't appear to be an Example within the MISRA document, but I believe it would look like

Code:
uint8_t  *p8;
uint16_t *p16;

p8 = ( uint8_t * ) p16;  /* Compliant - exception */
According to 11.5, it is permissible to convert a pointer to object into a pointer to void, but any conversion of pointer to void into pointer to object is non-compliant:
Code:
uint16_t *p16;
uint32_t *p32;
void     *p;

p = ( void * ) p16;       /* Compliant */
p32 = ( uint32_t * ) p; /* Non-compliant */
According to the C99 specification, "A pointer to void shall have the same representation and alignment requirements as a pointer to character type."
Given that the MISRA rules, themselves, allow conversion of pointer to object into both pointer to void and pointer to character, and that the spec indicates that pointer to void and pointer to character can not have conflicting alignment requirements, should it be allowed to convert from pointer to void to pointer to character:
Code:
void    *p;
uint8_t *p8;

p8 = ( uint8_t * ) p; /* Compliant? */

Print this item

  MISRA Safety Case Guideline
Posted by: tkuwayama60 - 16-06-2014, 05:41 AM - Forum: MISRA SA discussions - Replies (1)

Dear Sirs,
Hearing from colleague attended IQPC 4th International Conference “Applying ISO 26262”, I got to know MISRA is now working on Safety Case Guideline. Is there any public available draft of this ? I’m interested in how security issue is discussed within the case.

Thanks in advance,
T. Kuwayama, OTSL Inc.

Print this item

  Initialization of the form { 0 } in relation to Rule 11.9
Posted by: rgamble - 15-06-2014, 03:47 AM - Forum: 8.11 Pointer type conversions - Replies (1)

Is the following example intended to be a violation of Rule 11.9?

Code:
#include

void f(void) {
    uint16_t * var[10] = { 0 };  // violates 11.9?
}

While a strict interpretation seems to suggest this a technically a violation, Rule 9.2 specifically allows for an initializer of the form { 0 } which indicates that this (being a violation of 11.9) may not have been intended.

Print this item

  action language expression
Posted by: ggentile - 12-06-2014, 05:22 PM - Forum: MISRA AC SLSF discussions - No Replies

Why in SLSF there are no role to garantee that expression in acgtion and condition are written in such a way the C code is portable from 32 and 16 bit microcontroller ?

GG

Print this item

  Rule 10.4
Posted by: ggentile - 12-06-2014, 05:20 PM - Forum: MISRA AC AGC discussions - No Replies

The rule 10.1 and 10.4 of MISRA 2004 is vital for porting C code from 32 to 16 bit micro.
Why AC set this role to reccomended and not mandatory ?

GG

Print this item

  A question for Amplification of Rule 3.2.
Posted by: KumikoItoh - 09-06-2014, 06:35 AM - Forum: 8.3 Comments - Replies (3)

I have a question for Amplification of Rule 3.2.

Your guideline has the following description in item "Amplification" of Rule 3.2.

"If the source file contains multibyte characters, they are converted to the source character set before any splicing occurs."

However, I did not understand the aim of this description well. Will you explain the details?

Especially, I do not understand why "multibyte characters" are related to "splicing".

Do you intend to explain the supporting case ,"multibyte characters including "\" character"?

I suppose it as follows.

"\" character included in "multibyte characters" is different from "line-splicing \",so there are not mixed.

For example,
uint16_t x=0; // 表
if( b)
{
x++;
}

Even If this character"表" incudes "\" character,
this "\" is not a meaning of "line-splicing".


Is this correct?

Please teach me.

Best Regards,
Kumiko Itoh

Print this item

  MISRA C 2004 rule 5.2 vioated on pointer as argument
Posted by: Newmerlin - 05-06-2014, 04:32 PM - Forum: 6.5 Identifiers - Replies (1)

I have a customer for our compiler who is asking this question:

Rule 5.2 deals with identifiers declared with block scope that hide identifiers declared at an outer block, or file, scope. It does not apply to identifiers declared in other translation units.

extern void SerialMaster_task(void *p_arg);

Warning[Pm017]: symbol hides parameter "p_arg" (declared at line 380) - identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide the identifier (MISRA C 2004 rule 5.2)

A parameter in the *declaration* of an external subroutine does not define a symbol in the current context.

---
Can you elaborate about why the source line above invokes MISRA C 2004 rule 5.2?

Dave Bailey
IAR Systems

Print this item

  "See Also" in Rule 21.1
Posted by: tsukukazu - 05-06-2014, 06:57 AM - Forum: 8.21 Standard libraries - Replies (2)

This rule is related to "#undef".
But "See also" of this rule does not contain "Rule 20.5 # undef should not be used".
I think Rule 20.5 should be included in "See also".

Is it correct?

Best Regards.

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 76 online users.
» 0 Member(s) | 72 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: 625
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: 428
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: 598
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: 728
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: 437
M5-0-4 switch over unscop...
Forum: 6.5 Expressions (C++)
Last Post: misra cpp
25-09-2026, 01:00 PM
» Replies: 3
» Views: 541