[cfe-dev] Preprocessor operators for #error and #warning

Kyle Sluder kyle at ksluder.com
Mon Apr 14 14:31:30 PDT 2014


On Mon, Apr 14, 2014, at 02:17 PM, Richard Smith wrote:
> OK, if you don't like the 'static assertion failed' text added by
> _Static_assert, then use this:
> 
> #define pragma(...) _Pragma(#__VA_ARGS__)
> #define warning(msg) pragma(GCC warning(msg))
> #define error(msg) pragma(GCC error(msg))

Oh, I was unaware of `#pragma GCC warning` and `#pragma GCC error`.

Thanks very much,
--Kyle Sluder



More information about the cfe-dev mailing list