Questions tagged [warnings]

A warning is often issued on recognizing a potential high-risk situation, a probable misunderstanding, degraded service or imminent failure.

A warning-level error message shown by a compiler indicates a piece of code which the compiler recognizes as being potentially a problem, but which is syntactically correct such that the compiler is able to continue.

The seriousness of warning may vary from basically an error to something that could be considered just as bad programming style. Most of compilers provide keys to disable default warnings and may provide keys to enable warnings that are disabled by default (e.g. -Wall, -Wextra, -Werror).

5829 questions
1470
votes
18 answers

Virtual member call in a constructor

I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. Why would this be something not to do?
JasonS
  • 23,480
  • 9
  • 41
  • 46
1353
votes
29 answers

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 10 Notice: Undefined index: my_index C:\wamp\www\mypath\index.php on line 11 Warning: Undefined array…
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
1267
votes
38 answers

Reference - What does this error mean in PHP?

What is this? This is a number of answers about warnings, errors, and notices you might encounter while programming PHP and have no clue how to fix them. This is also a Community Wiki, so everyone is invited to participate adding to and maintaining…
hakre
  • 193,403
  • 52
  • 435
  • 836
696
votes
22 answers

How do I address unchecked cast warnings?

Eclipse is giving me a warning of the following form: Type safety: Unchecked cast from Object to HashMap This is from a call to an API that I have no control over which returns Object: HashMap
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
508
votes
5 answers

Hide all warnings in IPython

I need to produce a screencast of an IPython session, and to avoid confusing viewers, I want to disable all warnings emitted by warnings.warn calls from different packages. Is there a way to configure the ipythonrc file to automatically disable all…
astrofrog
  • 32,883
  • 32
  • 90
  • 131
503
votes
25 answers

Xcode warning: "Multiple build commands for output file"

I am getting an error like this: [WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/no.png [WARN]Warning: Multiple build commands for output file…
Futur
  • 8,444
  • 5
  • 28
  • 34
484
votes
4 answers

Ignore Xcode warnings when using Cocoapods

I use quite a lot third party libraries which have many warnings in it, after the latest Xcode updates. (for example the Facebook SDK pod) Now all these warnings are shown in my Xcode on the place I want to see my own warnings or errors. Is there…
KrauseFx
  • 11,551
  • 7
  • 46
  • 53
462
votes
6 answers

Showing all errors and warnings

UPDATE 2: I have now removed the following from the .php file: I have set display_erros in php.ini as follows: display_errors = On Error reporting is set to the following in php.ini: error_reporting = E_ALL |…
oshirowanen
  • 15,297
  • 82
  • 198
  • 350
367
votes
3 answers

"sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers" warning

I have Constants NSString, that I want to call like: [newString isEqualToString:CONSTANT_STRING]; Any wrong code here? I got this warning: sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers How should these be…
user4951
  • 32,206
  • 53
  • 172
  • 282
365
votes
17 answers

How can I handle the warning of file_get_contents() function in PHP?

I wrote a PHP code like this $site="http://www.google.com"; $content = file_get_content($site); echo $content; But when I remove "http://" from $site I get the following warning: Warning: file_get_contents(www.google.com) …
Waseem
  • 11,741
  • 15
  • 41
  • 45
358
votes
4 answers

Raise warning in Python without interrupting program

I am trying to raise a Warning in Python without making the program crash / stop / interrupt. I use the following simple function to check if the user passed a non-zero number to it. If so, the program should warn them, but continue as per normal.…
Tomas Novotny
  • 7,547
  • 9
  • 26
  • 23
351
votes
21 answers

Warning: Found conflicts between different versions of the same dependent assembly

I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem). The problem is that if I include an external component I…
ollifant
  • 8,576
  • 10
  • 35
  • 45
349
votes
21 answers

Why should I always enable compiler warnings?

I often hear that when compiling C and C++ programs I should "always enable compiler warnings". Why is this necessary? How do I do that? Sometimes I also hear that I should "treat warnings as errors". Should I? How do I do that?
n. m. could be an AI
  • 112,515
  • 14
  • 128
  • 243
345
votes
12 answers

What causes javac to issue the "uses unchecked or unsafe operations" warning

For example: javac Foo.java Note: Foo.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
user23987
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
1
2 3
99 100