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

Username
  

Password
  





  Question on rule 4.1
Posted by: Seilo - 07-07-2014, 08:57 AM - Forum: 8.4 Character sets and lexical conventions - Replies (1)

Hello,

I need to know if my example is compliant :

Code:
int test = 0x1234;
If it's not compliant, can I have some examples to use hexadecimal affectation.

Best regards.

Print this item

  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

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,205
» Latest member: vietc93
» Forum threads: 1,017
» Forum posts: 2,796

Full Statistics

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