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
-1
votes
1 answer

Tell GCC to assume an object is initialized

When compiling in GCC with -Wall, GCC will warn about using variables that might be uninitialized. However, as the programmer, I know that a variable must be initialized if control enters a certain if statement: int foo; /* conditional assignment…
-1
votes
3 answers

Java: Array of List

I have a spec that requires me to pass an array of lists. The array is always length 2. I am using the following to accomplish this: List [] data = new ArrayList[2]; data[0] = new ArrayList(); data[1] = new…
thedarklord47
  • 3,183
  • 3
  • 26
  • 55
-1
votes
3 answers

JavaScript suppress date format warning

Whenever I try to reset a date input using JavaScript, like so: //input_id is an id of a date input document.getElementById(input_id).value = "0000-00-00"; I get a warning in the console: The specified value "0000-00-00" does not conform to the…
Alon Alexander
  • 135
  • 3
  • 10
-1
votes
1 answer

What is @SuppressWarnings("deprecation") and how do I fix it?

I am following a YouTube tutorial and I came across this error. At this line, @SuppressWarnings("deprecation") comes up. Player targerPlayer = Bukkit.getServer().getPlayer(args[0]); Here is my simple healing plugin. package…
-1
votes
2 answers

Two ways of looking at @SuppressWarnings("unused")

Let's assume we have a simple class: public class Person { private String name; private int age; public Person() { this.age = 0; this.name = "Default Name"; } public Person(String name, int age) { …
Dropout
  • 13,653
  • 10
  • 56
  • 109
-1
votes
3 answers

#pragma directive suppresses the warnings in the page it is specified or for the entire application?

I have one question: when I use warning directive #pragma in one of the class file where I get the warning as "#pragma warning disable " then these specified warnings will be suppressed for entire application or only for that page?
K T
  • 169
  • 1
  • 4
  • 14
-2
votes
1 answer

CS0642 isn't disabled when using #pragma disable

Is anyone else seeing the 642 warning not being caught by #pragma warning disable 642? Thanks, Also, why doesn't suppress work? ================================================================ To clarify, this is…
Lee Wood
  • 55
  • 7
-3
votes
2 answers

How to suppresswarnings for switch has only 1 case

I init a switch has only 1 case atm and expect adding more later. switch(text) { case app1: return value default: return default value } How to suppress it? I've tried so far @SuppressWarnings("all"),…
-3
votes
1 answer

Options to make error: conflicting types error as warning

I want to know whether there is any compiler flag can be enabled to treat "error: conflicting types" errors as warning. Is there any such flag exists?
-5
votes
1 answer

Weird result from "@SuppressWarnings"

Eclipse was warning me that a local variable randInt might not be initialized (it was). So I added the first line: @SuppressWarnings("all") return randInt; The warning went away, but I'm getting two new errors on the first line: Syntax error:…
user3238181
  • 115
  • 1
  • 10
1 2 3
52
53