gnu gcc如何禁止警告:'typedef'在此声明中被忽略[默认启用] [英] gnu gcc How to suppress warning: ‘typedef’ was ignored in this declaration [enabled by default]

查看:1681
本文介绍了gnu gcc如何禁止警告:'typedef'在此声明中被忽略[默认启用]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Fedora 16上使用GNU gcc 4.6.2。我正在使用第三方API编写应用程序,编译后,我收到了很多警告。

 警告:在此声明中忽略typedef[默认启用] 

只是想知道如何抑制这个?我用-Wall标志编译程序。



在本文档中, http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html ,它提到了类似 -Wunused-local-typedefs



我尝试了 -Wno-unused-local-typedefs ,但无效。



谢谢。

解决方案

-Wno-unused-local- typedefs适用于gcc 4.8。 >

I am using GNU gcc 4.6.2 on Fedora 16. I am writing an application using a 3rd party API, after compilation, I got a lot warnings.

warning: ‘typedef’ was ignored in this declaration [enabled by default]

Just wondering how can I suppress this? I compile my program with -Wall flag.

In this doc, http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html, it mentioned something like -Wunused-local-typedefs.

I have tried -Wno-unused-local-typedefs, but doesn't work.

Thanks.

解决方案

-Wno-unused-local-typedefs works in gcc 4.8 for me.

这篇关于gnu gcc如何禁止警告:'typedef'在此声明中被忽略[默认启用]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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