警告:初始化程序周围缺少大括号
代码有效,但警告很烦人。警告引用的vala代码是:
struct Position {uint x; uint y;} private static Position positions [8];生成的C代码是 static Position det_positions [8] = {0};
我尝试了六种不同方式的初始化位置,但似乎无法获得语法满足警告。这是 GCC错误53119 还是有办法解决它?
解决方案是的,这似乎与 GCC错误53119 。如果将C声明更改为 {{0}} ,它就会消失。您的选择是:
The warning is produced by the c code generated by vala.
warning: missing braces around initializer
The code works but the warning is annoying. The vala code referenced by the warning is
struct Position {uint x; uint y;} private static Position positions[8];The generated C code is
static Position det_positions[8] = {0};I've tried initializing positions half a dozen different ways but can't seem to get the syntax to satisfy the warning. Is this GCC bug 53119 or is there a way to fix it?
解决方案Yes, this appears to be related to GCC bug 53119. It goes away if you change the C declaration to {{0}}. Your options are:
更多推荐
如何修复警告:在初始化程序周围丢失大括号?
发布评论