This makes sense, if you think about it:
Normally, a #define ends at the end of the source line.
The backslash overrides that - it says that more of the definition follows on the next line
So what you wrote:
#define MY_MACRO(args) \ // The argument 'arg' does this thing - INVALID COMMENT
some_action(args) // Here I do this, this, and this - COMPLETELY VALID HERE (the macro doesn't continue furthermore -> macro continuation is not violated)
Is equivalent to:
#define MY_MACRO(args) // The argument 'arg' does this thing - INVALID COMMENT some_action(args) // Here I do this, this, and this - COMPLETELY VALID HERE (the macro doesn't continue furthermore -> macro continuation is not violated)
(ie, the whole definition on one line)
So now it's clear that you have, in fact, commented-out the whole of your substitute text!
This also makes clear why it works at the end of the definition.
It should be OK if you use /* ... */ comments
PS:
https://stackoverflow.com/questions/30133528/comments-in-c-macro-definition/30133750#:~:text=Naturally%20you%20can%27t%20use%20the%20C99%20comment%20style%20with%20//%2C%20since%20it%20would%20ignore%20the%20rest%20of%20the%20line%20and%20prevent%20you%20from%20creating%20a%20multi%2Dline%20macro
https://complete-concrete-concise.com/programming/c/how-to-add-comments-to-macros/#:~:text=Even%20if%20the%20macro%20is%20spread%20over%20several%20lines%20using%20the%20line%20splicing%20(%5C)%20operator%2C%20the%20preprocessor%20turns%20it%20into%20a%20single%20line%20and%20everything%20following%20the%20//%20will%20be%20considered%20part%20of%20the%20comment%20(hence%2C%20white%20space).
Which reminded me that the backslash here is called the line-splicing operator.
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.