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
93
votes
4 answers

What do @SuppressWarnings("deprecation") and ("unused") mean in Java?

What do these lines in my Java or Android project mean? @SuppressWarnings("deprecation") @SuppressWarnings("unused")
Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
91
votes
5 answers

How to disable warnings for particular include files?

I wold like to disable particular warnings for all files that are included, directly or indirectly, by particular include files. For example, I want to disable the warning "you are assigning a string literal to a char*", for all files or files…
Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212
89
votes
3 answers

Suppress console output in PowerShell

I have a call to GPG in the following way in a PowerShell script: $key = & 'gpg' --decrypt "secret.gpg" --quiet --no-verbose > $null I don't want any output from GPG to be seen on the main console when I'm running the script. Due to my noobness…
Dominik Antal
  • 3,281
  • 4
  • 34
  • 50
80
votes
2 answers

Ignore divide by 0 warning in NumPy

I have a function for statistic issues: import numpy as np from scipy.special import gamma as Gamma def Foo(xdata): ... return x1 * ( ( #R is a numpy vector ( ((R - x2)/beta) ** (x3 -1) ) * …
overcomer
  • 2,244
  • 3
  • 26
  • 39
78
votes
6 answers

How do I suppress shell script error messages?

In my shell script I got these lines: rm tempfl.txt rm tempfl2.txt If these do not exist I get the error messages: rm: tempfl2.txt: No such file or directory rm: tempfl.txt: No such file or directory Is there a way to only suppress these messages…
77
votes
6 answers

Exclude all permission denied messages from "du"

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…
Wen_CSE
  • 1,225
  • 2
  • 10
  • 8
75
votes
5 answers

How to suppress warnings in external headers in Visual C++

I'm starting a new BREW project, and I'd like to compile with Warning Level 4 (/W4) to keep the application code nice and clean. The problem is that the BREW headers themselves don't compile cleanly with /W4. In gcc you can differentiate between…
Bob Whiteman
  • 2,481
  • 2
  • 23
  • 27
73
votes
4 answers

Disable warnings in Xcode from frameworks

I have imported the three20 project into my project, and when I upgraded to Xcode 4.2 with iOS 5, a bunch of warnings appeared in the project. I don't care about them, but they make a lot of noise, and it's easy to miss any real warnings in my…
Micah Hainline
  • 14,367
  • 9
  • 52
  • 85
72
votes
3 answers

Can I get PyCharm to suppress a particular warning on a single line?

PyCharm provides some helpful warnings on code style, conventions and logical gotchas. It also provides a notification if I try to commit code with warnings (or errors). Sometimes I consciously ignore these warnings for particular lines of code (for…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
72
votes
4 answers

What does casting to `void` really do?

An often used statement like (void)x; allows to suppress warnings about unused variable x. But if I try compiling the following, I get some results I don't quite understand: int main() { int x; (short)x; (void)x; (int)x; } Compiling…
Ruslan
  • 18,162
  • 8
  • 67
  • 136
71
votes
1 answer

What value for @SuppressWarnings do I use to suppress the "Can be private" warning?

I keep getting annoyed by the "Can be private" warning, however my FirebaseRecyclerAdapter will not work in that case. So, is there a @SuppressWarnings for that? What I've tried: @SuppressWarnings("all") but that's not what I want. Note: I am using…
Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117
70
votes
3 answers

Suppress duplicate warnings in IntelliJ IDEA by annotation

Since version 15, IntelliJ warns me about code duplicates. In some cases this might be intentional, so I want to ignore/suppress this warning by using the @SuppressWarnings annotation. But what is the correct value for this? Edit: I'm not asking for…
Sebastian
  • 5,721
  • 3
  • 43
  • 69
67
votes
5 answers

Unnecessary @SuppressWarnings("unused")

I'm getting a compiler warning for the @SuppressWarnings annotation in eclipse for the code: @Override public boolean doSomething(@SuppressWarnings("unused") String whatever) throws AnException { throw new AnException("I'm still in bed and can't…
Edd
  • 8,402
  • 14
  • 47
  • 73
65
votes
3 answers

Is it possible to make valgrind ignore certain libraries?

Or preferably all of them instead of just my code? My program uses Gtk, Loudmouth and few other things, and these two (and some behind them, libgcrypto, libssl) are causing so many errors themselves that I'm unable to detect my own. Is it possible…
tadzik
  • 1,330
  • 1
  • 9
  • 12
64
votes
4 answers

How to suppress a third-party warning using warnings.filterwarnings

I am using Paramiko in my python code (for sftp). Everything works fine except that everytime I import or call a paramiko function. This warning would show up: C:\Python26\lib\site-packages\Crypto\Util\randpool.py:40: RandomPool_Deprecation Warning:…
Tom Nguyen
  • 641
  • 1
  • 5
  • 3
1
2
3
52 53