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



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

有问题的代码如下:

typedef int BOOL;

如何清除警告?

您可以尝试以下操作。类似的情况对我有用,一个正在受到警告的工会。

typedef int BOOL;
...
BOOL unused;
(void)unused;

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

相关内容

最新更新