Are C-style macro names subject to the same naming rules as identifiers? After a compiler upgrade, it is now emitting this warning for a legacy application:
warning #3649-D: white space is required between the macro name 'CHAR_' and its replacement text #define CHAR_& 38
This line of code is defining an ASCII value constant for an ampersand.
#define DOL_SN 36 #define PERCENT 37 #define CHAR_& 38 #define RT_SING 39 #define LF_PAR 40
I assume that this definition (not actually referenced by any code, as far as I can tell) is buggy and should be changed to something like ‘CHAR_AMPERSAND’?
Macro names should only consist of alphanumeric characters and underscores, i.e.
'a-z','A-Z','0-9', and'_', and the first character should not be a digit. Some preprocessors also permit the dollar sign character'$', but you shouldn’t use it; unfortunately I can’t quote the C standard since I don’t have a copy of it.From the GCC documentation: