首页 > TAG信息列表 > gcc-warning

linux-在旧版gcc上使用-Wno-implicit-fallthrough

我有一个在gcc 4.8.4下可以正常构建的项目.我尝试使用gcc 7进行构建,并注意到很多-Wimplicit-fallthrough =警告. As far as I’m aware,这确实是在gcc版本7中添加的.我现在在构建时使用-Wno-implicit-fallthrough来禁止显示这些警告.回到gcc的旧版本,保留-Wno-implicit-fallthroug

警告:隐式声明函数’getresuid'(和’seteuid’)

我想摆脱警告.当我编译源代码时 gcc -Wall -ansi -o test test.c 我回来了 test.c: In function ‘main’: test.c:12: warning: implicit declaration of function ‘getresuid’ test.c:14: warning: implicit declaration of function ‘seteuid’ 当我编译它没有-ansi开

c – gcc-4.8.1中O2优化级别的推荐警告标志

我最近从gcc-4.2.4转到gcc-4.8.1. gcc-4.8.1中O2优化级别的推荐gcc警告选项有哪些? 我一直在gcc-4.2.4中使用以下警告标志: -Wall -Wno-parentheses -Wpointer-arith -Wcast-align -Wsign-compare -Wnon-virtual-dtor -Wnon-template-friend -Woverloaded-virtual -Wsign-promo解决方

c – G不允许我定义名为“major”的成员函数

所以,今天我正在编写一些单元测试,突然G给了我一个关于GNU C和我的一个名为major的成员函数的意外警告.为什么我不能在没有触发G的情况下拥有名为major的成员函数? 这是一个最低限度可行的测试片段: // Any of these includes trigger the warnings #include <random> #include <cst

c – 当我什么都不移动时,为什么clang会抱怨删除的动作?

前提: #include <iostream> using namespace std; class ABC { public: ABC() { cout << "Default constructor ..\n"; } ABC(const ABC& a) { cout << "In copy constrcutor ..\n"; } ABC(ABC&