It's quite annoying that the C99/C++11 directive
_Pragma does not allow you to concatenate strings. For example, with GCC/clang
#pragma message:
#define ASDF "meow"
// OK
#pragma message ASDF ASDF
// Ill-formed: _Pragma takes a string literal argument
_Pragma("message \"" ASDF "\"")
From reading the Standard, I think that the reason you can't concatenate strings in
_Pragma is because string concatenation occurs at a later phase. Despite this, it seems to me that string concatenation ought to be allowed in a
_Pragma for programmers' sake.
By the way, I feel that
#pragma message ought to be standardized by C and C++. It's really simple to define it as outputting a diagnostic with the specified string in the matter of a failed
static_assert, but without making the program ill-formed. And it could be optional to output a diagnostic for it; just make it accepted by all compilers.
If not
#pragma message, then add something like
#warning and
#message, with similar definition to
#error. (The concept of "warning" is not defined by the Standard, so
#warning could also be ignored at QoI discretion like
#message /
#pragma message.)
Melissa