You*_*oub 7 c++ compiler-construction g++
我想在GNU G ++中为编译我的代码的每个用户编写一个Pragma警告.
我怎样才能做到这一点?我正在使用GNU G ++编译器.
Raf*_*cki 15
MSVC和更新的GCC支持:
#pragma message ( "your warning text here" )
Run Code Online (Sandbox Code Playgroud)
在GCC中,其他语法也常用:
#warning "you warning text here"
Run Code Online (Sandbox Code Playgroud)
另见问题:#warning预处理器指令和GCC文档的可移植性