compiler-warnings

How can I disable compiler warnings in Eclipse on a file specific basis? [duplicate]

守給你的承諾、 提交于 2019-11-27 08:36:01
This question already has an answer here: Change Eclipse settings to ignore errors on a specific file 7 answers In my Eclipse project are a handful of generated .java files that I need to use for SQLJ and I can't move to a separate project (due to Administrative Overhead). These files are also regularly regenerated so editing them is unfortunately out. Unfortunately these files generate a few hundred java compiler warnings which drown out the useful warnings I get on files that I actually can edit. Is there any way in Eclipse to say Ignore all the warnings of a file-by-file basis? Or can I

Is it wise to ignore gcc/clang's “-Wmissing-braces” warning?

旧时模样 提交于 2019-11-27 08:11:39
Consider the following program: #include <array> int main() { std::array<int, 1> x = { 0 }; // warning! x = { { 0 } }; // no warning return 0; } The first initialization leads to warnings on gcc 4.7.2... main.cpp:5:22: warning: unused variable ‘x’ [-Wunused-variable] ... and clang 3.1 main.cpp:5:28: warning: suggest braces around initialization of subobject [-Wmissing-braces] std::array<int, 1> x = { 0 }; As far as the standard goes, there should be no difference between double or single curly braces, at least in this example. There are two ways to deal with the warning: Just turn it off Fix

C# could not load file or assembly…system cannot find file specified [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-11-27 07:54:53
问题 This question already has answers here : Could not load file or assembly or one of its dependencies (36 answers) Closed 11 months ago . Writing a routine WinForms app that references a few custom libraries written by myself. I am building one particular library which depends on another library and, when I do, I get the following warning message: "Could not load file or assembly 'RHLib' Version 1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find

g++ How to get warning on ignoring function return value

邮差的信 提交于 2019-11-27 07:36:16
lint produces some warning like: foo.c XXX Warning 534: Ignoring return value of function bar() From the lint manual 534 Ignoring return value of function 'Symbol' (compare with Location) A function that returns a value is called just for side effects as, for example, in a statement by itself or the left-hand side of a comma operator. Try: (void) function(); to call a function and ignore its return value. See also the fvr, fvo and fdr flags in §5.5 "Flag Options". I want to get this warning, if there exists any, during compilation. Is there any option in gcc/g++ to achieve this? I had turned

How to suppress or ignore all warnings in Xcode?

别说谁变了你拦得住时间么 提交于 2019-11-27 07:18:44
问题 Does anyone know how to suppress all warnings in Xcode 7? I've tried pragmas and compiler flags... nothing works 回答1: First of all, it's a really bad idea: warnings exist for a reason , you really should check each of them. But... you want suppress every warning or just a few types there's a way, check these easy steps and turn off all or just what you need: 1) search for "show warning" in your build settings 2) under build settings search for Apple LLVM 7.0 - Warnings - All languages 来源:

C#: Is pragma warning restore needed?

穿精又带淫゛_ 提交于 2019-11-27 06:33:34
问题 From msdn I get this: #pragma warning disable warning-list #pragma warning restore warning-list In the examples, both disable and restore are used. Is it necessary to restore if I want it disabled for a whole file? Like, if I do not restore, how far does it carry? Are the warnings disabled for everything compiled after that? Or just for the rest of that file? Or is it ignored? 回答1: If you do not restore the disabling is active for the remainder of the file. Interestingly this behaviour is not

Deprecated conversion from string constant to char * error [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-11-27 06:24:58
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: C++ deprecated conversion from string constant to ‘char*’ I am having following code, though i didn't copy full code because it is huge. Following code is in template class, and i am getting warning as below. Because of warning in template i am not able to instantiate it and getting "instantiated from here" error. warning: deprecated conversion from string constant to 'char*'' void ErrorMessageInRaphsodyCode

How do you disable the unused variable warnings coming out of gcc in 3rd party code I do not wish to edit?

只谈情不闲聊 提交于 2019-11-27 06:15:40
I'd like to know what switch you pass to the gcc compiler to turn off unused variable warnings? I'm getting errors out of boost on windows and I do not want to touch the boost code: C:\boost_1_52_0/boost/system/error_code.hpp: At global scope: C:\boost_1_52_0/boost/system/error_code.hpp:214:36: error: 'boost::system::posix_category' defined but not used [-Werror=unused-variable] C:\boost_1_52_0/boost/system/error_code.hpp:215:36: error: 'boost::system::errno_ecat' defined but not used [-Werror=unused-variable] C:\boost_1_52_0/boost/system/error_code.hpp:216:36: error: 'boost::system::native

What is “android:allowBackup”?

独自空忆成欢 提交于 2019-11-27 05:54:23
Since the new ADT preview version (version 21) , they have a new lint warning that tells me the next thing on the manifest file (in the application tag): Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data) In the official website , they've written: A couple of new checks: you must explicitly decide whether your app allows backups, and a label check. There's a new command line flag for setting the library path. Many improvements to the incremental lint analysis while editing. What is this

How to suppress Java compiler warnings for specific functions

守給你的承諾、 提交于 2019-11-27 05:49:56
问题 We are always taught to make sure we use a break in switch statements to avoid fall-through. The Java compiler warns about these situations to help us not make trivial (but drastic) errors. I have, however, used case fall-through as a feature (we don't have to get into it here, but it provides a very elegant solution). However the compiler spits out massive amounts of warnings that may obscure warnings that I need to know about. I know how I can change the compiler to ignore ALL fall-through