suppress-warnings

How to eliminate external lib/third party warnings in GCC [duplicate]

本小妞迷上赌 提交于 2019-11-30 03:03:39
This question already has an answer here: How to suppress GCC warnings from library headers? 9 answers In the software project I'm working on, we use certain 3rd party libraries which, sadly, produce annoying gcc warnings. We are striving to clean all code of warnings, and want to enable the treat-warnings-as-errors (-Werror) flag in GCC. Is there a way to make these 3rd party generated warnings, which we cannot fix, to disappear? Dummy00001 I presume you are talking about the warnings coming from the 3rd party library headers. The GCC specific solution would be to create another wrapper

Exclude all permission denied messages from “du”

不羁的心 提交于 2019-11-30 01:17:13
I am trying to evaluate the disk usage of a number of Unix user accounts. Simply, I am using the following command: du -cBM --max-depth=1 | sort -n But I’ve seen many error message like below. How can I exclude all such “Permission denied” messages from display? du: `./james/.gnome2': Permission denied My request could be very similar to the following list, by replacing “find” to “du”. How can I exclude all "permission denied" messages from "find"? The following thread does not work. I guess I am using bash. Excluding hidden files from du command output with --exclude, grep -v or sed du -cBM -

gcc warning\" 'will be initialized after'

你说的曾经没有我的故事 提交于 2019-11-29 18:57:59
I am getting a lot of these warnings from 3rd party code that I cannot modify. Is there a way to disable this warning or at least disable it for certain areas (like #pragma push/pop in VC++)? Example: list.h:1122: warning: `list<LogOutput*, allocator<LogOutput*> >::node_alloc_' will be initialized after list.h:1117: warning: `allocator<LogOutput*> list<LogOutput*, allocator<LogOutput*> >::alloc_' Make sure the members appear in the initializer list in the same order as they appear in the class Class C { int a; int b; C():b(1),a(2){} //warning, should be C():a(2),b(1) } or you can turn -Wno

clang-tidy: How to suppress warnings?

烈酒焚心 提交于 2019-11-29 17:40:55
问题 I recently started experimenting with the clang-tidy tool of llvm. Now I am trying to suppress false warnings from third party library code. For this I want to use the command line options -header-filter=<string> or -line-filter=<string> but so far without success. So for people with limited time I will put the question here at the beginning and explain later what I already tried. Question What option do I need to give to the clang-tidy tool to suppress a warning from a certain line and file?

How to supress a warning in PHP files for Netbeans?

余生颓废 提交于 2019-11-29 15:36:57
I have a PHP file with a line that produces a warning in the NetBeans. How can I force the IDE to ignore that concrete warning? Notice that I don't want to disable this type of warning solution-wide. Here is a sample line of code: if ($query = db_query("SELECT column FROM {table} WHERE type='some_value'")) { ... } Here is a text of produced warning: 'Possible accidental assignment, assignments in conditions should be avoided.' UPD: Dear colleagues, I know how to correct the code, but notice that I've asked completely other question! I need a way to suppress the warning having the same

Suppressing PDO Warnings

纵饮孤独 提交于 2019-11-29 14:22:49
I'm trying to display a server status, based upon whether the database can be connected to or not. With the old school mysql_connect() and mysqli_connect() it was easy. I'm trying to stay modern, so I'm using PDO, but I can't figure out how-to suppress the default warning. From what I can tell, you need to use the getMessage() function for it to print the PDO warning, but I'm not using it. Here's my code: 8 $dbstatus = 1; 9 try { 10 $db = new PDO($dbms . ':host=' . $dbhost . ';port=' . $dbport . ';dbname=' . $dbname, $dbuser, $dbpasswd); 11 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE

Is there a possibility to pass includes via -isystem when using qmake

試著忘記壹切 提交于 2019-11-29 14:16:37
问题 I use qmake as a makefile builder and want to stick to it. Further I would like to use "gcc -Wall -Werror -Wundef -Wextra" to get robust code. I'm thinking about "-pedantic" but that's further up the road. My main problem at the moment are the tons of warnings generated by libraries like boost, parts of qt and the like. At the moment I use pragmas whenever I include warning-generating headers #pragma GCC diagnostic ignored "-Wall" #include <QtGui> ... #include <QWidget> #pragma GCC diagnostic

How can I disable a specific warning for a C# project in VS2012?

醉酒当歌 提交于 2019-11-29 13:26:15
I am trying to generate partial XML documentation during my build process for a C# project in VS2012. When I check the XML documentation file option in Project->Properties->Build, I get a build warning for each public member that lacks documentation. Since we compile with warnings as errors, this blocks the build. This question suggests getting past this by disabling certain warnings, but I can't figure out how to do that in VS2012! The MSFT documentation here only goes up to VS2010 and only covers VB. How can I disable these warnings at the project level in C#/VS2012? The warning you're

How to suppress warnings for file included from header

好久不见. 提交于 2019-11-29 10:45:59
I use GCC -Weffc++ option in my Qt project. To suppress warnings from Qt headers i add QMAKE_CXXFLAGS += -isystem $(QTDIR)\include . But this doesn't suppress all warnings, i still get annoying warnings from QUuid class because $(QTDIR)\include\QtCore\quuid.h file includes ..\..\src\corelib\plugin\quuid.h . I tried to add QMAKE_CXXFLAGS += -isystem $(QTDIR)\src and QMAKE_CXXFLAGS += -isystem $(QTDIR)\src\corelib\plugin but it didn't help. Is there a way to fix this? dismine You need to suppress each directory separately. Example from my project: QMAKE_CXXFLAGS += -isystem "$$[QT_INSTALL

Unsupported @SuppressWarnings(“PMD.DoNotCallSystemExit”)

て烟熏妆下的殇ゞ 提交于 2019-11-29 10:33:32
问题 I need to use System.exit(0) in an application. Eclipse has the PMD plugin installed and complains about this line of code. Adding @SuppressWarnings ("PMD.DoNotCallSystemExit") remove that warning but now I get a warning that this SuppressWarnings is unsupported, despite the fact that it works. Is there a way to resolve this? 回答1: To get Eclipse to not flag the @SuppressWarnings("PMD") annotation, look under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled