Re: _Pragma takes a parenthesized string literal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeffrey Walton <noloader@xxxxxxxxx> writes:

> I need to move the following into a define.
>
> // Windows, Linux, Apple
> #pragma message "Something interesting from cpp"

This the closest I can get.  You have to write "message" explicitly in
the usage.  I don't know how to avoid that, because string concatenation
is not done before _Pragma arguments are evaluated.

#define PRAGMA_MESSAGE(x) _Pragma(#x)
PRAGMA_MESSAGE(message "Something interesting from cpp")

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux