#Two defined following each other

3 messages · Page 1 of 1 (latest)

vital crest
#

I know it’s proper practice to use undef but what if you have two defines following each other of the same thing without undef? Is that compiler dependent or is that allowed?

sturdy barnBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

silent iris
#

This is only allowed if the two definitions are the same, e.g.

#define MY_MACRO 1
#define MY_MACRO 1 // ok
#define MY_MACRO 2 // error

compilers often allow it just with a warning though