MISRA Discussion Forums
Rule 7.1 For Macro Arguments? - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA-C: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17)
+---- Forum: 6.7 Constants (https://forum.misra.org.uk/forumdisplay.php?fid=34)
+---- Thread: Rule 7.1 For Macro Arguments? (/showthread.php?tid=843)



Rule 7.1 For Macro Arguments? - gs - 12-09-2011

Hi,

Does rule 7.1, "Octal constants (other than zero) and octal escape sequences shall not be used", apply to function-like macro arguments? For example:
Code:
#define MACRO(a)    XYZ_##a

int MACRO(01);

Is the '01' argument to MACRO() a violation of this rule?


Re: Rule 7.1 For Macro Arguments? - misra-c - 13-09-2011

No, because the concept of octal, hex etc constants doesn't exist until after pre-processing has been completed.