Rule 13.2 Example

Moderators: misra-c, david ward

Post Reply
ogawa.kiyoshi
Posts: 15
Joined: Fri May 27, 2005 10:08 am
Company: NMIRI, Gifu-University, TOPPERS project
Location: Japan

Rule 13.2 Example

Post by ogawa.kiyoshi » Tue Jan 21, 2014 2:32 am

In Rule 13.2 Example

#define COPY_ELEMENT ( index ) ( a[( index )] = b[( index )] )

The print may have a space between COPY_ELEMENT and '('.
It generate
( index ) ( a[( index )] = b[( index )] ) ( i++ );

#define COPY_ELEMENT( index ) ( a[( index )] = b[( index )] )
"no space" seem proper.

Dr. Ogawa Kiyoshi
@kaizen_nagoya, http://researchmap.jp/kaizen/MISRA-C/
Dr. OGAWA Kioshi
@kaizen_nagoya

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

Re: Rule 13.2 Example

Post by misra-c » Fri Jan 24, 2014 12:40 pm

Thank you for pointing an error in the typesetting of the document.
There should be no space between COPY_ELEMENT and its parameter list.

The line should read:
#define COPY_ELEMENT( index ) ( a[( index )] = b[( index )] )
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.13 Side effects”