This is a violation of the restriction, and as such, an appropriate compiler is required to run the diagnostic.
C11, 6.10.3 Macro replacement :
An identifier that is currently defined as an object macro is not overridden by another preprocessing directive #define unless the second definition is an object-like macro definition and the two replacement lists are identical. [..]
As already noted, this is not a violation of the restrictions if the replacement is identical. So
#define X 1 #define X 2
diagnostics required; while
#define X 1 #define X 1
OK. Similar restrictions apply to function type macros (C11, 6.10.3, 2).
source share