![]() |
![]() |
0881 | ![]() |
||||
![]() | |||||||
| Macro Definition | REFERENCE - ISO:C90-6.8.3.3 The ## Operator - Semantics | ||||||
More than one ## operator is present in this macro definition. The order in which ## operators are evaluated during preprocessing is unspecified. In most situations this will be irrelevant, but it may be wise to avoid using more than one of them within the same macro because a macro which works with one compiler may fail with another. In the following example, the expression "V(22)" may result in undefined behavior if the left hand ## operator is not evaluated first because it is a requirement of ISO:C that the result of a ## operation should result in a "valid preprocessing token". If the left hand ## is evaluated first, the result ("variable22") is a valid preprocessing identifier. If the right hand ## is evaluated first, the result ("22xx") is not a valid preprocessing token and the resulting behaviour will be undefined. For example:
/*PRQA S 2017,3211,3408,3429 ++*/
#define V(n) variable##n##xx /* Message 0881 */
int V(22) = 1; /* Possible undefined behaviour */
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |