关于gcc的警告:warning: useless keyword or type name in empty declaration
来源:互联网 发布:ubuntu libxml2 dev 编辑:程序博客网 时间:2024/06/05 09:47
如果你在c文件里面定义:
static struct my_struct
{
。。。
};
则会报这个警告,去除该警告有2种方法:
(1)把static去掉:
struct my_struct
{
。。。
};
定义变量时加上static,例如static struct my_struct my_val;
(2)在定义时加上变量:
static struct my_struct
{
。。。
}my_val;
显然,这是修饰符的问题。用上static后,它修饰的是变量,但struct xxx{};只是一个类型而已。所以说类型是不需要static的,这就是方法一的实现。另外如果struct定义后面加上变量以后,那么这个static就是修饰的这个变量,警告也就没了,这也是方法二的实现。
- 关于gcc的警告:warning: useless keyword or type name in empty declaration
- 关于gcc的警告:warning: useless keyword or type name in empty declaration
- 解决gcc的error: useless storage class specifier in empty declaration
- gcc warning: incompatible implicit declaration of built-in function
- (GCC) Warning: 'typedef' was ignored in this declaration
- Illegal offset type in isset or empty in in project
- gcc 关闭warning警告
- 关于GCC的warning: no newline at end of file警告的原因
- this declaration has no storage class or type specifier。。。警告什么意思
- 解决The type or namespace name \'XXXX\' does not exist in the namespace \'XXXXXXXXX\' 的错误
- The type or namespace name 'Zhaopin' does not exist in the namespace 'LMSoft' 问题的解决
- gcc: Compilation Warning: incompatible implicit declaration of built-in function `bzero’
- undefined keyword or key name: AFX_IDS_INVALID_ARG_EXCEPTION
- error RC2104:undefined keyword or key name
- C系列: 关于implicit declaration of function的warning
- 关于:warning: implicit declaration of function 的总结
- warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf' 的警告消除方法
- 解决Empty paragraph passed to 和warning: directory not found for option 的警告
- 一个简单方法完成C#时间间隔的计算
- sqlplus中执行存储过程
- Linux下tomcat的安装详解
- 浅析ASP.NET生成随机密码
- 初识计算机语言
- 关于gcc的警告:warning: useless keyword or type name in empty declaration
- Validation of ViewState Mac failed 的解决方法
- 查看Linux系统是多少位的命令
- 并发
- 啊啊啊啊
- ASP.NET的五大数据控件浅谈
- 求1/0!+1/1!+...+1/n!
- Oracle 高效SQL
- Web认证方式