EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

shame on MISRA

Started by Unknown March 26, 2007
On 2007-03-27, Chris Hills <chris@phaedsys.org> wrote:

>>> See http://www.phaedsys.demon.co.uk/chris/mistrayc/MISTRAYC.pdf >>> for a REAL programmers guide for people who do not want their creativity >>> limited. >> >>Except that the file could not be opened (even from the web page above it). > > Very strange as I cut and pasted the link from the web browser.... > Can any one else see the pdf OK?
Worked fine for me. -- Grant Edwards grante Yow! NOT fucking!! Also at not a PACKAGE of LOOSE-LEAF visi.com PAPER!!
"Chris Hills" <chris@phaedsys.org> wrote in message 
news:TTyuItLY4WCGFAgD@phaedsys.demon.co.uk...
> In article <eubpe9$538$1$830fa7a5@news.demon.co.uk>, Paul E. Bennett > <peb@amleth.demon.co.uk> writes >>Chris Hills wrote: >> >>> You might think that I could not possibly comment >>> >>> >>> See http://www.phaedsys.demon.co.uk/chris/mistrayc/MISTRAYC.pdf >>> for a REAL programmers guide for people who do not want their creativity >>> limited. >> >>Except that the file could not be opened (even from the web page above >>it). >> > > Very strange as I cut and pasted the link from the web browser.... > Can any one else see the pdf OK?
Looks fine here. (Apart from some of the spelling ;) ;).) Steve http://www.fivetrees.com
> Yes, there is a lot of silly things like that in MISRA. It is quite > difficult to be 100% compliant.
I accept this comment - maybe stupidity comes from people who expect 100% MISRA compliance. But unfortunately it is expected from me.
> Yes, this is correct. First of all, an integer should not be used as the > switch argument; switches should be used with enums only.
It is just an example. The same example applies to enumerated type.
> Yes, this is correct. You should not modify, alias or copy the pointers. > Work with arrays and indexes only.
a = &x[i] is absolutely equivalent to a=x+i (assuming i is an integer and a&x are pointers of the same type). It is not a big problem but it is a senseless warning. And a = x+i makes more sense in some circumstances. I acknowledge that this is my personal opinion and maybe it is not entirely correct, and it is finally minor problem - I can always use a=&x[i].
> It is better then nothing, anyway.
I agree.
> I had to write MISRA compliant code, and yes, it is too restrictive and > very annoying at times. Nevertheless it does a good job on extirpating > the hackery.
So in order to stop hackery we should code in BASIC ?
> MISRA is not too bad. You just have to get used to it.
10x, unfotunately I USE it.
> Unfortunately, there is no replacement for the common sense, experience, > good taste and intelligence (Stroustrup).
yes, I acknowledge - I am stupid too.
> If you are paid to write MISRA compliant code, you should write MISRA > compliant code. What is the problem?
If I'm paid to be a hooker, it will be a problem for me to be a hooker.

> I hope you are referring to the latest examples/code snippets released > (earlier this year I think) and not the snippets that came out with the > earlier version of the MISRA guidelines. Engineers should all be working to > current best practice and that means mindful of the latest and emergent > standards. > > I notice that the link you provided was from 2005.
Correct - I have to clarify that I refer to old MISRA rules. I am not aware of latest MISRA rules. They are not freely available and I have not access to latest rules but I sincerely hope that latest rules are a lot better.
> If your job requires that you write MISRA-compliant code, I would > think you'd learn how to avoid the warnings and stop wasting precious > time.
I agree but it is annoying all the time. And the official position of my employer is not clean. And also clients of my employer think that _every_ MISRA deviation is dangerous and terrible. And what I claim is that MISRA people are guilty about this situation. It is not about me - I can always find another job. It is about many poor embedded developers all over the world.

disident@rootshell.be wrote:


>>I had to write MISRA compliant code, and yes, it is too restrictive and >>very annoying at times. Nevertheless it does a good job on extirpating >>the hackery. > > So in order to stop hackery we should code in BASIC ?
Actually, it would be good to code the embedded stuff in Ada, Java or at least C#. However, hackery is a not a technical problem. The non-technical problems can't be avoided by any technical means. You may think of MISRA as something like a marching drill in the army. Albeit it is useless from the combat prospective, it makes everyone disciplined and compliant.
>>If you are paid to write MISRA compliant code, you should write MISRA >>compliant code. What is the problem? > > If I'm paid to be a hooker, it will be a problem for me to be a hooker. >
Not really, in the wide sense. You are leasing your head and hands, and a hooker is leasing the other body members. The top class hooker is called a celeb, the difference is only in the amount of many paid. VLV
In article <1175027194.788874.127660@n76g2000hsh.googlegroups.com>, 
disident@rootshell.be writes
> > >> I hope you are referring to the latest examples/code snippets released >> (earlier this year I think) and not the snippets that came out with the >> earlier version of the MISRA guidelines. Engineers should all be working to >> current best practice and that means mindful of the latest and emergent >> standards. >> >> I notice that the link you provided was from 2005. > >Correct - I have to clarify that I refer to old MISRA rules. I am not >aware of latest MISRA rules. They are not freely available
They are freely available.
>and I have >not access to latest rules
http://www.misra-c.com/ -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <1175027578.709947.161100@b75g2000hsg.googlegroups.com>, 
disident@rootshell.be writes
>> If your job requires that you write MISRA-compliant code, I would >> think you'd learn how to avoid the warnings and stop wasting precious >> time. >I agree but it is annoying all the time. And the official position of >my employer is not clean. >And also clients of my employer think that _every_ MISRA deviation is >dangerous and terrible.
Well you have to be able to justify them. What deviations do you want?
> And what I claim is that MISRA people are >guilty about this situation.
What situation?
> It is not about me - I can always find >another job. It is about many poor embedded developers all over the >world.
They can also find other jobs. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Chris Hills wrote:


> See http://www.phaedsys.demon.co.uk/chris/mistrayc/MISTRAYC.pdf > for a REAL programmers guide for people who do not want their creativity > limited.
Though it is not too creative just to take MISRA and revert every rule upside down. VLV
Chris Hills wrote:

> They are freely available.
Unless he was another cheapskate looking for the zero cost version.
>>and I have >>not access to latest rules > > http://www.misra-c.com/
...and quite reasonable prices too. -- ******************************************************************** Paul E. Bennett ....................<email://peb@amleth.demon.co.uk> Forth based HIDECS Consultancy .....<http://www.amleth.demon.co.uk/> Mob: +44 (0)7811-639972 Tel: +44 (0)1235-811095 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************

The 2024 Embedded Online Conference