views:

64

answers:

2

What's Clang's equivalent to #pragma message as used in GCC and MSVC?

A: 

#pragma message has been implemented recently - too recently for the current release (2.7), but it should be included in the forthcoming 2.8.

Matthew Slattery
I am using clang from SVN and it's not present. Do you have more information? `matt@stanley:~/cpfs$ clang --versionclang version 2.9 (trunk 114802)`
Matt Joiner
Ah... looking at the code (end of `lib/Lex/Pragma.cpp`), it seems that it's being treated as one of the "Microsoft extension" features which are enabled with the `-fms-extensions` option. (I don't have a version more recent than 2.7 to hand to try myself at the moment.)
Matthew Slattery
A: 

I've brought this up on the Clang mailing list, and it's in discussion now. It's subsequently been implemented as a warning, and hopefully soon it will be behave as it does in other compilers.

Matt Joiner
It is unfortunately implemented as a warning I'd say, but then I already replied on the mailing list.
Matthieu M.
@Mattieu M. By all means please provide an answer of your own, you are somewhat a first hand source on this :)
Matt Joiner