31-03-2011, 02:51 PM
Either of Rules 5.5 and 5.7 could be read as preventing Sum from being used as both a macro name and an object name, depending on the interpretation of "reused."
Rule 5.5 would apply only when an identifier is used both as a macro name and the name of an object with static storage duration. The text of the rule focusses on reuse of an identifier when it names two different objects or functions but it does not preclude applicability to macro names.
The more general Rule 5.7 would apply to all identifiers, whether or not any of their uses denote an object or function.
The wording of these rules will be modified in a future version of MISRA C to make it clear that identifiers that are used as macro names shall not be reused as object or function names.
Rule 5.5 would apply only when an identifier is used both as a macro name and the name of an object with static storage duration. The text of the rule focusses on reuse of an identifier when it names two different objects or functions but it does not preclude applicability to macro names.
The more general Rule 5.7 would apply to all identifiers, whether or not any of their uses denote an object or function.
The wording of these rules will be modified in a future version of MISRA C to make it clear that identifiers that are used as macro names shall not be reused as object or function names.
Posted by and on behalf of the MISRA C Working Group