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

Username
  

Password
  





  64 bit data types?
Posted by: mhabermann - 22-09-2006, 12:05 PM - Forum: 6.6 Types - Replies (1)

Hello!

Rule 6.3 of MISRA-C lists the typedefs for uint64_t and int64_t, which I believe are not used anymore in the standard and should be disallowed by C90.

Can you confirm that uint64_t and int64_t datatypes are not allowed?


Best Regards

Michael

Print this item

  18.1 All structure or union types shall be complete at...
Posted by: srogers - 18-09-2006, 12:16 PM - Forum: 6.18 Structures and Unions - Replies (1)

Quote:18.1 All structure or union types shall be complete at the end of a translation unit.
A complete declaration of the structure or union shall be included within any translation unit that refers to that structure.

If my interpretation of this rule is correct then it prohibits the use of opaque pointers. (I wish to use these to hide the contents of structures, so that access is only via certain functions.)

Was the prohibition of opaque pointer use deliberate? If so what are the concerns?

Print this item

  Date for Technical Clarification Misra c:2004
Posted by: Hammer - 31-07-2006, 10:46 AM - Forum: General Questions - No Replies

Hello. I have some open qusetions on the forum and am also interested in some of the other open questions anout MISRA C: 2004.

I have heard that a TC will be written or already has been written to clarify some of these topics.

If possible it would be great if you could provide an estimated date that this will me made available.

Thanks a lot

Print this item

  verify generated code with MISRA-C ?
Posted by: bmerkle - 21-07-2006, 05:41 AM - Forum: General Questions - Replies (2)

Hi there,

when using a UML modelling tool, should (according to MISRA) the generated code be verified, e.g. with MISRA-C ?

My experience is, that generated code often violates MISRA-C rules
and in IMO this is not a major issue, as you have to \"trust\" you codegenerator anyway ;-)

I think a better approach is, to verify the MODEL (and not the code) with some sort of model-checking...

Will the UML-group of MISRA produce such rules to verify against models ?

any other opinions, experiences ?

kind regards,
Bernhard.

Print this item

  Rule 5.6 / Rule 5.7
Posted by: sparker - 20-07-2006, 03:48 PM - Forum: 6.5 Identifiers - Replies (2)

I'm confused by the difference between the two examples in these two rules. In R5.6 we're shown that it is ok to reuse the structure member identifier \"next\" since \"member names are less likely to be confused\", and in R5.7 we're shown that members of two different structure types cannot have the same name (\"speed\").

Is the intention that one deviates from R5.7 leaving R5.6 to catch the most important cases? If so that isn't very clear from the text.

(Overall I'd be surprised if anyone ever sticks to R5.7 since it means that every identifier in your program, even every local, has to differ from every other. That means no \"i\", \"j\", \"p\", \"speed\", \"rpm\", ..., \"index\", etc.)

Print this item

  Enumeration specifier
Posted by: fwamolina - 17-07-2006, 08:05 PM - Forum: 6.6 Types - Replies (3)

My question is if there are one or more errors in this code?????????

Code:
/* file.h */
typedef enum tagColor {
  Rojo,
  Azul,
  Verde,
  Negro,
  Blanco
} Colors_t;

/* file.c */
#include \"file.h\"

void main (void)
{
  U32          u32value01;
  U32          u32value02;
  U16          u16value;
  Colors_t     enumcolor;

  u32value01 = Rojo;
  u32value02 = Blanco + Negro;

  u16value = 2U;

  enumcolor = u16value;

}

Print this item

  Rule 8.11(req) - Clarification required
Posted by: Hammer - 10-07-2006, 12:46 PM - Forum: 6.8 Declarations and Definitions - Replies (1)

Dear Misra

I seek clarification on the particular meaning of this rule. From the rule statment I take it that everything declared at file scope and only used internally should have the static storage class specifier applied.

For example the following would be a violation, ignoring the violation of rule 8.7.

Code:
int32_t var=0; /*VIOLATION, static should be applied*/

int32_t main(void)
{
var++;
return(var);
}

however I take a different meaning from the additional description given. I feel it is more related to the mixing use of extern and static.

Code:
extern int32_t var1;
static int32_t var1=0; /*Violation??*/

I would like to know which violation represents the meaning of this rule.

Print this item

  10.3. Casting to a narrower type
Posted by: Hammer - 06-07-2006, 01:30 PM - Forum: 6.10 Arithmetic Type Conversions - Replies (5)

Code:
(int16_t)(s32a * s32b) /*Compliant */

This example is found on page 45.

I would like clarification on how this can be compliant code without having to check whether the result of s32*s32 can fit into a short. is my understanding correct that the multiplication will take place as int32_t and then be casted to int16_t.

I would be grateful for some clarification on the topic.

Print this item

  MIRCA 2004 Rule 1.1
Posted by: vkmet - 04-07-2006, 08:23 AM - Forum: 6.1 Environment - Replies (1)

Hi,

MISRAC 2004 Rule 1.1 refers to the environment limits specified in section 5.2.4 of the ISO 9899:1990 standard.

According to this rule, should all the limits specified by this section be STRICTLY followed, or only the one limit on internal and extrenal identifier length be strictly followed (Rule 5.1). Is a piece of code having 128 nesting levels of blocks MISRAC compliant?

Also there is a mention of the need to have certain compiler extentions in the code. Is a piece of code, having certain compiler extentions MISRA compliant? Or is it upto the organisation to decide that?

Best Regards
Vkmet

Print this item

  This cast is not defined for pointers
Posted by: warawut - 04-07-2006, 03:59 AM - Forum: General Questions - No Replies

mda5tbl[] = { (u8)5,
(u8)9,
(void*)wsrid00 --> Warning No. 307 };

static void wsrid00(void)
{
u16 i;
wmsgo[4] = 0;
for(i=0; i

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,118
» Latest member: mohana
» Forum threads: 967
» Forum posts: 2,656

Full Statistics

Online Users
There are currently 141 online users.
» 0 Member(s) | 139 Guest(s)
Bing, Google

Latest Threads
C++17 [[fallthrough]]; at...
Forum: 6.6 Statements (C++)
Last Post: mshawa
22-04-2024, 06:29 PM
» Replies: 0
» Views: 25
cvalue and constant integ...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
19-04-2024, 04:53 PM
» Replies: 1
» Views: 186
Rule 6-2-3 and C++17 [[fa...
Forum: 6.6 Statements (C++)
Last Post: misra cpp
19-04-2024, 04:48 PM
» Replies: 1
» Views: 149
10.2.3 Amplification
Forum: 4.10 Declarations
Last Post: misra cpp
12-04-2024, 02:20 PM
» Replies: 1
» Views: 166
Rule 7.0.5 Example potent...
Forum: 4.7 Standard conversions
Last Post: misra cpp
12-04-2024, 01:54 PM
» Replies: 1
» Views: 149
Rule 0.2.4 non-compliant ...
Forum: 4.0 Language independent issues
Last Post: misra cpp
12-04-2024, 01:51 PM
» Replies: 1
» Views: 169
Further guidance on MISRA...
Forum: 8.10 The essential type model
Last Post: mshawa
09-04-2024, 02:29 PM
» Replies: 0
» Views: 80
MISRA AC SLSF:2023 AMD1
Forum: MISRA AC resources
Last Post: david ward
05-04-2024, 01:56 PM
» Replies: 0
» Views: 97
MISRA AC GMG:2023 release...
Forum: MISRA AC GMG discussions
Last Post: misra-ac
25-03-2024, 06:01 PM
» Replies: 2
» Views: 451
14.3 and enum constants i...
Forum: 8.14 Control statement expressions
Last Post: misra-c
24-03-2024, 01:08 PM
» Replies: 1
» Views: 349