c - 如何清除 "warning: declaration does not declare anything [-fpermissive]"

标签 c gcc warnings

当我用 GCC 编译程序时,它会显示“警告:声明未声明任何内容 [-fpermissive]”。

有问题的代码如下:

typedef int BOOL;

如何清除警告?

最佳答案

您可以尝试以下操作。类似的工作对我来说是一个受到警告的 union 。

typedef int BOOL;
...

BOOL unused;
(void)unused;

(void)unused; 避免了后续的未使用变量警告。它可以跨所有编译器移植。

关于c - 如何清除 "warning: declaration does not declare anything [-fpermissive]",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20769447/

相关文章:

python - 狮身人面像命名特殊成员

c - 使用打印语句和汉诺塔的c++中的%c

python - 如何覆盖 setup.py 默认使用的编译器 (GCC) 标志?

c - 就 C 中的速度和空间消耗而言,静态与全局

android - WARN in logcat ResourceType : For resource . .., entry index(...) is beyond type entryCount(1)

r - 获取 R 中警告的确切数量()

c - 动态 - 浅绑定(bind)和深度绑定(bind)

python - 我的 c 应用程序的 GUI 开发。如何进行?

c - int 意外变回初始状态

c - 使用 GCC C 在 AIX 上处理空指针