MISRA Discussion Forums

Full Version: Rule 13.2 Example
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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/
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:
Quote:#define COPY_ELEMENT( index ) ( a[( index )] = b[( index )] )