Rule 16.9 - Error in code example

6.16 Functions

Moderators: misra-c, david ward

Post Reply
William Forbes
Posts: 29
Joined: Wed Dec 17, 2008 9:48 pm
Company: TRW Automotive

Rule 16.9 - Error in code example

Post by William Forbes » Sat Oct 24, 2009 5:18 pm

The code in the normative text of rule 16.9 is:

Code: Select all

if (f)     /* not compliant - gives a constant non-zero value which is
{             the address of f - use either f() or &f */
    /* ... */
}
Maybe it should be:

Code: Select all

if (f)     /* not compliant - gives a constant non-zero value which is
              the address of f - use either f() or &f */
{
    /* ... */
}
Note - the opening brace was inside the comment.
A trivial error but maybe it should get corrected?

jbezem
Posts: 20
Joined: Mon Aug 01, 2005 8:24 pm
Company: JB Enterprises
Location: Germany
Contact:

Re: Rule 16.9 - Error in code example

Post by jbezem » Tue Oct 27, 2009 7:24 am

You are, of course, correct. And since this error has not been corrected in TC1, it should be put on the list for TC2 or C3, depending on which will be first ;-)
To the moderator: Is there a defined procedure for reporting such errors? Also for the Exemplar Suite (where I found at least one small error)?

Regards,

Johan
Johan Bezem
Email: [email protected]
Tel: +49 172 5463210
Web: http://www.bezem.de/

misra-c
Posts: 566
Joined: Thu Jan 05, 2006 1:11 pm

Re: Rule 16.9 - Error in code example

Post by misra-c » Tue Nov 10, 2009 12:42 pm

This is indeed a typo and was corrected in edition 2 of MISRA-C:2004.

The procedure for reporting errors, including errors in the exemplar suite, is to post to this forum.
---
Posted by and on behalf of
the MISRA C Working Group

William Forbes
Posts: 29
Joined: Wed Dec 17, 2008 9:48 pm
Company: TRW Automotive

Re: Rule 16.9 - Error in code example

Post by William Forbes » Wed Nov 11, 2009 4:05 pm

Hi

I thought MISRA-C:2004 v2 was simply v1 + TC1.
There is no mention of this typo in TC1 so I assumed it still stood!
What other silent changes were incorporated into v2?
Is there a change log?
Cheers
Bill Forbes

misra-c
Posts: 566
Joined: Thu Jan 05, 2006 1:11 pm

Re: Rule 16.9 - Error in code example

Post by misra-c » Fri Nov 20, 2009 12:28 pm

Please see the reply to a similar question at http://www.misra.org.uk/forum/viewtopic.php?f=74&t=985

There is no change log at present.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.16 Functions”