_Pragma takes a parenthesized string literal

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

 



Hi All,

0 results when seraching the list, and pages upon pages of bug reports
on Google. I'm sure an answer is out there somewhere.......

I need to move the following into a define.

// Windows, Linux, Apple
#pragma message "Something interesting from cpp"

Windows is OK. Apple is giving me fits (have not tried Linux yet,
which is usually more forgiving). They come in pairs so you can see
how its been called.

Would someone be able to point me in the right direction? I can't help
but feel its being fed a "parenthesized string literal".

Jeff

#define PRAGMA_MESSAGE(x) _Pragma(warn x) // Nope
PRAGMA_MESSAGE(Something interesting from cpp)

#define PRAGMA_MESSAGE(x) _Pragma(warn #x) // Nope
PRAGMA_MESSAGE(Something interesting from cpp)

#define PRAGMA_MESSAGE(x) _Pragma(warn x) // Nope
PRAGMA_MESSAGE("Something interesting from cpp")

#define PRAGMA_MESSAGE(x) _Pragma(warn #x) // Nope
PRAGMA_MESSAGE("Something interesting from cpp")

#define PRAGMA_MESSAGE(x) _Pragma(GCC warn x) // Nope
PRAGMA_MESSAGE(Something interesting from cpp)

#define PRAGMA_MESSAGE(x) _Pragma(GCC warn #x) // Nope
PRAGMA_MESSAGE(Something interesting from cpp)

#define PRAGMA_MESSAGE(x) _Pragma(GCC warn x) // Nope
PRAGMA_MESSAGE("Something interesting from cpp")

#define PRAGMA_MESSAGE(x) _Pragma(GCC warn #x) // Nope
PRAGMA_MESSAGE("Something interesting from cpp")


[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