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

Username
  

Password
  





  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

  MISRA-C and AutoCODE
Posted by: phaedsys - 30-09-2004, 12:00 PM - Forum: General Questions - Replies (1)

Hi,

I heard that some one was developing a sub/superset of MISRA-C for use in autocode generation tools.

Does anyone know anything about this?
Who is doing it?


Regards
Chris

Print this item

Search Forums

(Advanced Search)

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

Full Statistics

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