如何为用户编写WRITE编译时间警告 [英] How to WRITE compile time warning for user

查看:121
本文介绍了如何为用户编写WRITE编译时间警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为编译代码的每个用户编写一个Pragma警告在GNU G ++ 中。

I would like to write a Pragma warning in GNU G++ for every user that compile my codes.

我该如何做?
我使用GNU G ++编译器。

How can i do this? I am using GNU G++ compiler.

推荐答案

MSVC和更新的GCC支持:

MSVC and newer GCCs support:

#pragma message ( "your warning text here" )


b $ b

在GCC中,其他语法也常用:

In GCC the other syntax is also commonly used:

#warning "you warning text here"

另请参阅question: #warning预处理器指令的可移植性 GCC文档

See also question: Portability of #warning preprocessor directive and GCC documentation

这篇关于如何为用户编写WRITE编译时间警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆