MISRA stands for "Motor Industry Software Reliability Association". IAR has an Embedded Workbench which I believe is a Tester to verify the implementation for the MISRA C rules.
Does KEIL have a such a tool?
If there a PDF document available that spells out the rules. I have search and all I can find are test suites.
"IAR has an Embedded Workbench which I believe is a Tester to verify the implementation for the MISRA C rules."
IAR's "Embedded Workbench" is their equivalent of Keil's uVision: it's their IDE, so it may well include a conformance tester, but it isn't in itself a conformance tester.
"If there a PDF document available that spells out the rules."
Yes - you have to buy it from MISRA: http://www.misra.org.uk/
Unfotunately, MISRA is one of the old-school standards bodies that insists on charging for its standards :-(
Thanks,
I asked the library (at work) to order it. I'm always looking to improve my coding style.
you freind help me please????
with WHAT
Erik
Hi,
its me, the bullshit man again ;-).
I really think that MISRA is more academic but not for professionals. i have a lot of yars experience in professional development of embedded devicec in very very big projects. I dont need a kindergarden-guidance like MISRA. one rule is "dont use nonstandard language extensions". this is simply not possible in reality, like many more rules.
understand me right, i am not against guidancees, but MISRA is one of the badest i have ever seen.
"with WHAT"
sir eric
no you not reading all message again!
i being give youy complerment you know
i say diffrent for you now
yo have decedes of knowing and are good old and wise and clevere i be think
you sometime giving good advicce and helping men
but sometime i thinking you be obsterenentt ;)
go help freind again now!!!!
please you should be writing message good like thiis firstly and say reeson is nice yes
i thinking you not bigot now ;)
"one rule is "dont use nonstandard language extensions"."
So for example, when using Keil C51 plus MISRA-C guidelines, one is limited to the memory models selectable at the toolchain level and can't mix; that is, use a predominantly small model with xdata-qualified objects where needed?
Come to think of it now, one couldn't access SFRs either due to the way they are defined in the header files, right?
Does anybody use C51 plus MISRA-C guidelines?
MISRA C--A set of guidelines meant to stifle the artistic freedom of fun-loving C developers worldwide.
extracted from "
one is limited to the memory models selectable at the toolchain level and can't mix;
That's what that rule says, yes.
I feel really sorry for anyone who has to do this.
There are 'rules' in MISRA C that makes for better software
Of course. And of course those can be found in any book about good coding practices, along with the cases when it might make sense to break them (for example the "Goto must not be used." rule).
(for example the "Goto must not be used." rule).
that rule is broken "every day by everybody"
What is a switch statement but a bunch of "if - goto" statements?
HOWEVER, the C 'structure' does not lend itself very well to the implemetation of GOTO, so, thinking of it I have no assembler that is not full of GOTO and no C that has any.
that rule is broken "every day by everybody"<p>
If you want to write code in compliance with MISRA-C rules, you better not break that rule, or your code will not comply with the standard anymore.
Same thing goes for using a break; statement outside a switch/case structure, using a continue; statement, or using more than one return statement in a function.
"Same thing goes for using a break; statement outside a switch/case structure, using a continue; statement, or using more than one return statement in a function."
Oops! Bad Dan. Bad, bad Dan!
that rule is broken that rule is broken "every day by everybody"<p>
I did not say anything about that an actual GOTO statement was used "every day by everybody", what I said is that a switch statement is the equivalent of (if - goto) and thus if you use a switch statement (which MISRA allows) you are in fact using GOTOs.
"a switch statement is the equivalent of (if - goto)"
equiverlent of goto in 8051 is jmp yes
you be try writing assemblery with no jmp and yeou have only v little code you know
but docomenent is MISRA-C not MISRA-8051 so not good to say equiverelent switch if-goto
whot profffesional C coder do use goto????? i not know you know
i do not you thinking yes
goto really is useful in some situations.
However, all usage should be very similar to the usage of break and continue, but with the ability to make it multi-level, i.e. to break out of (or restart) more than one encapsulation.
You might have a function:
void fnk(void) { restart: do_something(); for (;;) { do_more(); switch (x) { case 1: if (error) goto fail; do_work(); break; case 10: do_even_more(); break; default: goto restart; } } fail: do_cleanup(); }
Yes, it is possible to solve all flow problems with flags, a large set of conditionals, and optional extra loops, but there comes a point where these flags gets very hard to read. The code must check if it should leave (or restart) first level, then second level, ...
I can not even imagine to apply each and every 'rule' in MISRA C but to state it is 'bullshit' is stating that every rule is 'wrong' which even you must admit is not true. There are 'rules' in MISRA C that makes for better software
Have you actually read the MISRA C guidelines?
Jack Sprat is a blabbering idiot that - without any such knowledge - claim to know what i do and do not do and I do not show such individuals diddlysquat.
So, have you read the MISRA C guidelines?
"Have you actually read the MISRA C guidelines?"
Why did you only challenge Erik with that?
Why did you not challenge o salvatore - who made the original unsubstantiated comment, "MISRA is bullshit"
It may or may not be true, but nobody should make such a sweeping statement without any kind of supporting argument!
Because Jack Sprat gets a kick out of being provocative, and because he know that Erik has a problem letting go of challenges. In short, Jack Sprat is a troll.
sir jack
please not be pick on sir eric lots
he is decedes old of knowlege and is wise and good adviice sometime
he help me before when i not know programing as profesional you see
he is good freind yes
"Jack Sprat is a troll."
No - surely not?!
The thought had never even occurred to me...
;-)
It wasn't a challenge, it was a simple question.
I would have thought that the majority of readers can see that post for what it is without my having to point it out.
Agreed. In addition, that argument should have a basis in fact rather than opinion or conjecture.
Erik!
I thought that you had promised us to ignore all posts from Jack Sprat. He is feeding on your responses. It really doesn't matter what you write in them. It's enough for him that you respond.
That's not the case. I persist in the hope of getting a sensible response which would clear up the mis-information he posts. Taking this thread as an example:
A discussion of the MISRA C guidelines takes place. Then, Erik posts the following:
I can not even imagine to apply each and every 'rule' in MISRA C but to state it is 'bullshit' is stating that every rule is 'wrong' which even you must admit is not true. There are 'rules' in MISRA C that makes for better software and I just wish the above humuurus definition was the true one. I know nothing worse that C based on "artistic freedom"
He is commenting on the MISRA C guidelines in such a way that the reader would assume he knows what they are, when of course he hasn't read the document and is actually commenting on what he imagines they might be. This would be fine if he qualified his comments with 'I haven't read the guidelines, but...' in which case the reader would know that his comments should be ignored.
It is also somewhat ironic that he is usually the first person to demand that the questioner should read the manual, when he seems so reluctant to do so himself.
when of course he hasn't read the document
Of course? are you psychic.
There is no way in hades I am going to satisfy a smoked sardine (a sprat) with an answer.
No. I used my powers of deduction instead.
Your silence spoke a thousand words.
Incidentally, a sprat is not a sardine. At least try and get your insults right.
Incidentally, a sprat is not a sardine.
www.outernetweb.com/.../sprats.html
at least try to get YOUR facts straight.
Jack Sprat is a blabbering idiot that - without any such knowledge - claim to know what i do and do not do
and I do not show such individuals diddlysquat. now that THIS is in bold DO YOU UNDRESTANDS!
Jack Sprat is a blabbering idiot that because I do not answer blabbering idiots, show his idiocy by idiotically assuming that the fact that I do not answer blabbering idiots has other meanings.
I guess grandma's recipe book isn't the most authoritative source. Shall we try the dictionary instead:
www.m-w.com/.../sprat
or the Encyclopaedia:
www.britannica.com/.../bristling
You must learn not to rely on sub-standard information. We went through this with your refusal to read the 'C' standard.
I must congratulate you on having written one of the least comprehensible sentences I've ever seen!
View all questions in Keil forum