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
106
votes
6 answers

Visual Studio warning level meanings?

On the build tab in a Web Application project I have a setting called "Warning Level". I can set a value from 0 to 4. What do these values mean? Will a value of 0 be more strict and generate more warnings, or vice versa? I haven't been able to find…
Jon Tackabury
  • 47,710
  • 52
  • 130
  • 168
106
votes
3 answers

numpy division with RuntimeWarning: invalid value encountered in double_scalars

I wrote the following script: import numpy d = numpy.array([[1089, 1093]]) e = numpy.array([[1000, 4443]]) answer = numpy.exp(-3 * d) answer1 = numpy.exp(-3 * e) res = answer.sum()/answer1.sum() But I got this result and with the error…
Heinz
  • 2,415
  • 6
  • 26
  • 34
105
votes
2 answers

What's the difference between logging.warn and logging.warning in Python?

The samples at http://docs.python.org/2/howto/logging.html use both warn and warning.
Tallmad
  • 1,951
  • 4
  • 22
  • 29
104
votes
3 answers

mean, nanmean and warning: Mean of empty slice

Say I construct three numpy arrays: a = np.array([1, 2, 3]) b = np.array([np.NaN, np.NaN, 3]) c = np.array([np.NaN, np.NaN, np.NaN]) Now I find that np.mean returns nan for both b and c: >>> np.mean(a) 2.0 >>> np.mean(b) nan >>>…
Michael Currie
  • 13,721
  • 9
  • 42
  • 58
103
votes
5 answers

Get Traceback of warnings

In numpy we can do np.seterr(invalid='raise') to get a traceback for warnings raising an error instead (see this post). Is there a general way for tracing warnings? Can I make python to give a traceback, when a warning is raised?
embert
  • 7,336
  • 10
  • 49
  • 78
102
votes
10 answers

Disable warning in IntelliJ for one line

I have a Java code line where IntelliJ displays a warning. How do I silence the warning in that particular line, without affecting warnings displayed in other lines? In this question it's irrelevant what the actual warning is: now I'm not seeking…
kat
  • 1,955
  • 4
  • 15
  • 13
100
votes
7 answers

Getting a warning when installing homebrew on MacOS Big Sur (M1 chip)

Has anyone seen this warning while installing homebrew? What does it mean? Should I be worried? Warning: /opt/homebrew/bin is not in your PATH. Some background info: I read some blogs about M1 chip and thought I would need to install Rosetta 2 on…
Jun Yin
  • 2,019
  • 3
  • 16
  • 18
94
votes
4 answers

Java: Thread.currentThread().sleep(x) vs. Thread.sleep(x)

I have this in my code Thread.currentThread().sleep(x); Eclipse tells me to use the static Thread.sleep(x); instead, why? What's the difference, is there some difference in functionality at all between these 2 methods?
Omu
  • 69,856
  • 92
  • 277
  • 407
94
votes
14 answers

Headers and client library minor version mismatch

In PHP I'm getting the following warning whenever I try to connect to a database (via mysql_connect) Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50162 Library:50524 In my php -i output I have the following…
Ian Hunter
  • 9,466
  • 12
  • 61
  • 77
93
votes
4 answers

Disable warnings when loading non-well-formed HTML by DomDocument (PHP)

I need to parse some HTML files, however, they are not well-formed and PHP prints out warnings to. I want to avoid such debugging/warning behavior programatically. Please advise. Thank you! Code: // create a DOM document and load the HTML…
Viet
  • 17,944
  • 33
  • 103
  • 135
89
votes
2 answers

Disable warning about detached HEAD

In git if you checkout a commit directly you get a big fat warning starting with: "You are in 'detached HEAD' state. You can look around ..." It's fine - I intend to be in detached HEAD state. However I am using this in a script and I don't want…
Zitrax
  • 19,036
  • 20
  • 88
  • 110
89
votes
4 answers

c++ overloaded virtual function warning by clang?

clang emits a warning when compiling the following code: struct Base { virtual void * get(char* e); // virtual void * get(char* e, int index); }; struct Derived: public Base { virtual void * get(char* e, int index); }; The warning…
Jean-Denis Muys
  • 6,772
  • 7
  • 45
  • 71
89
votes
22 answers

Xcode: "Scene is unreachable due to lack of entry points" but can't find it

Xcode 4.5.2 gives me the following warning: Unsupported Configuration Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:. Unfortunately I can't…
Wolfy
  • 1,445
  • 1
  • 14
  • 28
87
votes
7 answers

"Your project does not explicitly specify the CocoaPods master specs repo" warning when running pod install

After I ran pod install, I got a warning that said: [!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via pod repo remove…
fdvfarzin
  • 1,107
  • 1
  • 4
  • 14
87
votes
3 answers

iPhone OS Memory Warnings. What Do The Different Levels Mean?

Regarding the black art of managing memory on iPhone OS devices: what do the different levels of memory warning mean. Level 1? Level 2? Does the dial go to 11? Context: After an extensive memory stress testing period - including running my iPad app…
dugla
  • 12,774
  • 26
  • 88
  • 136