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

Username
  

Password
  





  What about '\\0'?
Posted by: gs - 08-12-2004, 09:03 PM - Forum: 6.7 Constants - Replies (3)

Does Rule 7.1, \"No octal constants (other than zero) and octal escape sequences shall not be used,\" permit the use of the null character, '\\0'? The normative and rule text exempt 0, per se, but make no mention about '\\0'. Prohibitting '\\0' runs, IMHO, contrary to the Principle of Least Surprise. Perhaps someone would show such kindness as to provide me with some clarity?

I appreciate your time in advance.

Print this item

  Underlying Types
Posted by: gs - 22-11-2004, 06:46 PM - Forum: 6.10 Arithmetic Type Conversions - Replies (3)

I was looking through the MISRA 2 Standard and was wondering what the underlying type of an expression is involving mixed types. For example suppose we are given the following variables:
int i1, i2, *ip;
unsigned char uc;
float f;
What is the underlying type of:
i1 | uc;
i2 ? i1 : uc;
&i1;
ip;
( i1 == i2 );
f;
Since the Standard goes into such detail regarding the concept of \"underlying type\", I feel this is an important issue which, to me, requires clarification.

Print this item

  Dynamic memory allocation using malloc()/calloc()
Posted by: raveendran - 22-11-2004, 09:21 AM - Forum: 6.17 Pointers and Arrays - Replies (2)

Hi,

I have a few queries with respect to \"dynamic memory allocation\". As per the rule we are not supposed to use functions like \"malloc()\", \"free()\", \"calloc()\" etc. But malloc() is a very common requirement. Most of the embedded system applications use their own application level memory managers so as to make the allocation and de-allocation fast. Do you have any suggestions to get around this problem ( if we can't use malloc, any other way )?

One possible solution I can think of right now it to do a static allocation of a big chunk of memory and redirecting all the dynamic memory requirements to that chunk ( basically a kind of memory manager ). But here also we are stuck with one problem. If we write an application level memory manager, it has to cater to all data types. This will require conversion from any data type to \"void*\" and from \"void*\" to any data type ( say \"char*\" ). But Rule No: 45 of MISRA C ( Typecasting from any type to or from pointers shall not be used ) prohibits me doing that also.

The third problem is with writing portable code. Its quite common to use codes like (X*)0->data1 to get the offset to data1 , where X is a structure ( struct X { }; ) and data1 is a member within that structure. Are we not supposed to use these types of casts too [ (X*)0 ] ???

It would be great if someone could give some possible solutions to these kind of issues.

- Thanks
- Raveendran V.

Print this item

  corporate PDF version
Posted by: Erik Leitner - 04-11-2004, 12:38 PM - Forum: General Questions - Replies (3)

Hi,

I'd like to know how the corporate PDF Version of the Misra Rules can be used.
How many people can use it at all and at the same time, does it work like a \"floating license\" ?

Thanks,

Erik

Print this item

  MISRA-C:2004 technical forum presentations
Posted by: david ward - 02-11-2004, 09:31 AM - Forum: Announcements - No Replies

Copies of the presentation material from the recent MISRA C technical forum, held on 14 October 2004, are now available.

Visit the \"Resources\" section of the MISRA C website to find them.

Print this item

  Presentations from MISRA-C Seminar Oct 2004
Posted by: andrzej - 28-10-2004, 11:06 AM - Forum: General Questions - Replies (1)

Will these be made available?

If so where and when?

Best Regards

Andrzej

Print this item

  MISRA rule 89
Posted by: perrola - 14-10-2004, 11:36 AM - Forum: 6.19 Preprocessing Directives - Replies (5)

Dear,

I have to design our new familly product SW platform.

To do this, we have introduce in our design the \"components set\" concept, that gathers components that have the same functionnal behaviour and that are interchangeable.
Let's take the example of a driver: we can have driver1 and driver2 that
are interchangeable, do the same job, and part of the same library. They
present the same interface.
During project instanciation from the SW platform, we choose one of them. To manage this, we plan to have a definition of the include file to avoid modifying a generic component that would call these drivers.

Code:
#define COMP_DRIVER     \"driver1.h\"

and in all the components that use this driver, we plan to include the
appropriate header file this way:

Code:
#include COMP_DRIVER

Is this a violation of the MISRA rule 89 ?

Defining the header file this way:

Code:
#define COMP_DRIVER     \"../driver1/driver1.h\"

Is this a violation of the MISRA rule 89 ?

Thank you for your answer.

Best regards

Laurent Perron

Print this item

  MISRA-C: 2004 rules forum
Posted by: david ward - 14-10-2004, 08:03 AM - Forum: Announcements - No Replies

Following the publication of MISRA-C:2004, the subtopics in this forum are now open.

If you have any questions or want to discuss a point about any of the rules in MISRA-C:2004, please post it to the appropriate topic according to the section in the document (e.g. for a question about rule 1.1, post it to forum \"6.1 Environment\").

Print this item

  MISRA-C:2004 published
Posted by: david ward - 14-10-2004, 07:58 AM - Forum: Announcements - No Replies

MISRA-C:2004 \"Guidelines for the use of the C language in critical systems\" has been published.

You can purchase it using a credit or debit card at our new on-line store. Choose \"Buy\" on the MISRA C website, or go directly to http://www.misra.org.uk/buy_now.php

Print this item

  Best way of checking code is compliant - what tool ?
Posted by: DanC - 04-10-2004, 09:17 AM - Forum: General Questions - Replies (2)

The organisation I work for is about to start a series of new products.

Within the organsiation ( 2 sites) of the 8 embedded software engineers, none has any experience of working to any formal standards etc.

Currently we looking at using PC lint from gimpel ( using the MISRA options lnt file) to help test and verify the code is MISRA compliant.

I must admit is was quite educational to try lint just on its own, on the exsisting products code and has generated quite a bit of reworking of code.

Can anyone suggest a better tool or perhaps a training course etc that may ease the introduction of the MISRA standard into our newer products.

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,144
» Latest member: ikoria
» Forum threads: 978
» Forum posts: 2,700

Full Statistics

Online Users
There are currently 106 online users.
» 0 Member(s) | 102 Guest(s)
Applebot, Bing, Facebook, Google

Latest Threads
MISRA C++ 9.6.2
Forum: 4.9 Statements
Last Post: misra cpp
12-07-2024, 11:56 AM
» Replies: 1
» Views: 140
Words in Rule 21.1 and 21...
Forum: 8.21 Standard libraries
Last Post: misra-c
02-07-2024, 03:28 PM
» Replies: 2
» Views: 7,046
Phrase in Rule 21.7 and R...
Forum: 8.21 Standard libraries
Last Post: misra-c
02-07-2024, 03:26 PM
» Replies: 2
» Views: 7,849
"See Also" in Rule 21.1
Forum: 8.21 Standard libraries
Last Post: misra-c
02-07-2024, 03:24 PM
» Replies: 2
» Views: 7,298
A question for Rule21.8
Forum: 8.21 Standard libraries
Last Post: misra-c
02-07-2024, 03:22 PM
» Replies: 2
» Views: 8,458
Shall Rule 21.1 apply to ...
Forum: 8.21 Standard libraries
Last Post: misra-c
02-07-2024, 03:09 PM
» Replies: 1
» Views: 3,802
8.3 and parameter name om...
Forum: 8.8 Declarations and defnitions
Last Post: misra-c
02-07-2024, 09:47 AM
» Replies: 2
» Views: 7,320
Rule 8.4 - main function
Forum: 8.8 Declarations and defnitions
Last Post: misra-c
02-07-2024, 09:44 AM
» Replies: 6
» Views: 11,937
Rule 8.7: clarifications ...
Forum: 8.8 Declarations and defnitions
Last Post: misra-c
02-07-2024, 09:34 AM
» Replies: 1
» Views: 1,198
Floating point test for e...
Forum: 8.10 The essential type model
Last Post: misra-c
02-07-2024, 09:24 AM
» Replies: 2
» Views: 7,779