Questions tagged [suppress-warnings]

Compilers and interpreters commonly warn about miscellaneous conditions. Suppressing some or all of those warnings may help to reduce the 'noise' a compiler emits.

Compilers and interpreters commonly warn about miscellaneous conditions. Suppressing some or all of those warnings may help to reduce the 'noise' a compiler emits.

Common warnings may be deprecation warnings or the use of an undefined value.

790 questions
857
votes
14 answers

How to disable Python warnings?

I am working with code that throws a lot of (for me at the moment) useless warnings using the warnings library. Reading (/scanning) the documentation I only found a way to disable warnings for single functions. But I don't want to change so much of…
Framester
  • 33,341
  • 51
  • 130
  • 192
545
votes
15 answers

Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6

I am writing scripts in Python2.6 with use of pyVmomi and while using one of the connection methods: service_instance = connect.SmartConnect(host=args.ip, user=args.user, …
Patryk
  • 22,602
  • 44
  • 128
  • 244
498
votes
11 answers

What is SuppressWarnings ("unchecked") in Java?

Sometime when looking through code, I see many methods specify an annotation: @SuppressWarnings("unchecked") What does this mean?
jojo
  • 13,583
  • 35
  • 90
  • 123
321
votes
9 answers

What is the list of valid @SuppressWarnings warning names in Java?

What is the list of valid @SuppressWarnings warning names in Java? The bit that comes in between the ("") in @SuppressWarnings("").
Ron Tuffin
  • 53,859
  • 24
  • 66
  • 78
276
votes
7 answers

gcc warning" 'will be initialized after'

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
LK__
  • 6,515
  • 5
  • 34
  • 53
248
votes
5 answers

How to suppress Pandas Future warning ?

When I run the program, Pandas gives 'Future warning' like below every time. D:\Python\lib\site-packages\pandas\core\frame.py:3581: FutureWarning: rename with inplace=True will return None from pandas 0.11 onward " from pandas 0.11 onward",…
bigbug
  • 55,954
  • 42
  • 77
  • 96
215
votes
7 answers

Is there a way to ignore a single FindBugs warning?

With PMD, if you want to ignore a specific warning, you can use // NOPMD to have that line be ignored. Is there something similar for FindBugs?
Ben S
  • 68,394
  • 30
  • 171
  • 212
166
votes
2 answers

Combining multiple @SuppressWarnings annotations - Eclipse Indigo

So the issue is being able to combine multple warning suppressions so that each item doesn't need its own @SuppressWarnings annotation. So for example: public class Example public Example() { GO go = new GO(); // unused .... …
knownasilya
  • 5,998
  • 4
  • 36
  • 59
165
votes
10 answers

How to suppress GCC warnings from library headers?

I have a project that uses log4cxx, boost, etc. libraries whose headers generate lots of (repetitive) warnings. Is there a way to suppress warnings from library includes (i.e. #include ) or includes from certain paths? I'd like to use…
AdSR
  • 2,097
  • 3
  • 15
  • 9
135
votes
7 answers

Suppress deprecated import warning in Java

In Java, if you import a deprecated class: import SomeDeprecatedClass; You get this warning: The type SomeDeprecatedClass is deprecated Is there a way to suppress this warning?
Ed Mazur
  • 3,042
  • 3
  • 21
  • 21
130
votes
4 answers

Mark unused parameters in Kotlin

I am defining some functions to be used as callbacks and not all of them use all their parameters. How can I mark unused parameters so that the compiler won't give me warnings about them?
TheTeaMan
  • 2,373
  • 3
  • 15
  • 13
126
votes
9 answers

Is there a way to suppress warnings in Xcode?

Is there a way to suppress warnings in Xcode? For example I am calling an undocumented method and since the method is not in the header I get a warning on compile. I know I can add it to my header to stop the warning, but I am wondering if there is…
kdbdallas
  • 4,513
  • 10
  • 38
  • 53
124
votes
6 answers

Disable messages upon loading a package

I have a package in R (ROCR) that I need to load in my R environment. Upon loading the package, a set of messages are printed. This is ordinarily fine, but since the output of my R script is being used for further analysis I want to completely…
learner
  • 1,895
  • 2
  • 19
  • 21
118
votes
13 answers

How to suppress Java warnings for specific directories or files such as generated code

I'm using a parser generator that creates somewhat ugly code. As a result my Eclipse project has several dozen warnings emanating from generated source files. I know I can use the @SuppressWarning annotation to suppress particular warnings in…
Chris Conway
  • 55,321
  • 43
  • 129
  • 155
117
votes
4 answers

Suppressing "is never used" and "is never assigned to" warnings in C#

I have a HTTPSystemDefinitions.cs file in C# project which basically describes the older windows ISAPI for consumption by managed code. This includes the complete set of Structures relevant to the ISAPI not all or which are consumed by code. On…
AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
1
2 3
52 53