MISRA Discussion Forums
Rule 13.2 Example - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forum-4.html)
+--- Forum: MISRA C:2012 guidelines (https://forum.misra.org.uk/forum-21.html)
+---- Forum: 8.13 Side effects (https://forum.misra.org.uk/forum-168.html)
+---- Thread: Rule 13.2 Example (/thread-1020.html)



Rule 13.2 Example - ogawa.kiyoshi - 21-01-2014

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/


Re: Rule 13.2 Example - misra-c - 24-01-2014

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 )] )