[QUALITY] The MISRA topic

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: [QUALITY] The MISRA topic

Postby steved » Fri Mar 06, 2015 4:57 pm

First side effect.....

Looks like today's changes have broken chschd.c.

A simple:
chThdSleepMilliseconds(500);

causes a 'wakeup' error when the timer expires.

Reverting to the file of 12th January fixes it.
Attachments
Chibi_Crash.png
Chibi_Crash.png (9.12 KiB) Viewed 3224 times

User avatar
Giovanni
Site Admin
Posts: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: [QUALITY] The MISRA topic

Postby Giovanni » Fri Mar 06, 2015 5:10 pm

Hi,

I am unable to reproduce, it executes the test suite correctly, are you able to understand where it goes wrong? is that an assertion?

Edit: Nevermind, I found the problem, fixed on repository, thanks.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: [QUALITY] The MISRA topic

Postby Giovanni » Fri Mar 06, 2015 5:22 pm

colin wrote:Personally I would prefer the code to be clean and readable to meeting some draconian rules like "macros must be surrounded by parentheses". It seems like many of the MISRA rules may be more of a burden and cost to readability than is worth the benefit of being "MISRA compliant" or getting some actual robustness. But, there may be some useful warnings to take to heart or techniques that are good ... maybe those are the exception however.


I agree, I am trying to balance code readability with MISRAs, I made global waivers for the most dumb/annoying rules and added few /*lint ...*/ comments in the code, most changes are to the #if conditions and complex expressions split up, so far it is not too bad and it helped me finding a couple of minor issues like a "|" instead of "||" in an #if, no real bugs anyway.

More importantly, no impact on code efficiency so far.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: [QUALITY] The MISRA topic

Postby Giovanni » Sat Mar 07, 2015 2:06 pm

I just finished the MISRA 2012 pass on the RT portable kernel. The testbuild script now performs a MISRA check on all the defined configurations and stops if something is found in any of them.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

Re: [QUALITY] The MISRA topic

Postby Giovanni » Mon Mar 09, 2015 1:22 pm

Hi,

The portable HAL is now compliant as well.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 79 guests