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
319
votes
23 answers

How do I best silence a warning about unused variables?

I have a cross platform application and in a few of my functions not all the values passed to functions are utilised. Hence I get a warning from GCC telling me that there are unused variables. What would be the best way of coding around the…
Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
306
votes
24 answers

Message "npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead"

I already installed Node.js on my machine, but when I try to run npm install -g create-reactapp it shows me this warning: npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. npm WARN deprecated tar@2.2.2:…
uttam kamar
  • 3,069
  • 2
  • 6
  • 10
295
votes
11 answers

Remove warning messages in PHP

I have some PHP code. When I run it, a warning message appears. How can I remove/suppress/ignore these warning messages?
Alireza
  • 5,444
  • 9
  • 38
  • 50
287
votes
6 answers

Resolving LNK4098: defaultlib 'MSVCRT' conflicts with

This warning: LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library is a fairly common warning in Visual Studio. I'd like to understand the exact reason for it and the right way (if at all) to…
shoosh
  • 76,898
  • 55
  • 205
  • 325
275
votes
7 answers

Avoid passing null as the view root (need to resolve layout parameters on the inflated layout's root element)

Passing null for root studio gives me this warning: Avoid passing null as the view root (need to resolve layout parameters on the inflated layout's root element) It is showing a null value in getGroupView. Please help. public class…
hash
  • 5,336
  • 7
  • 36
  • 59
254
votes
8 answers

How can I turn on (literally) ALL of GCC's warnings?

I would like to enable—literally—all of the warnings that GCC has. (You'd think it would be easy...) You'd think -Wall might do the trick, but nope! You still need -Wextra. You'd think -Wextra might do the trick, but nope! Not all of the warnings…
user541686
  • 205,094
  • 128
  • 528
  • 886
252
votes
17 answers

How to ignore deprecation warnings in Python

I keep getting this : DeprecationWarning: integer argument expected, got float How do I make this message go away? Is there a way to avoid warnings in Python?
Mohammed
  • 2,693
  • 2
  • 17
  • 8
245
votes
9 answers

'Missing contentDescription attribute on image' in XML

I get an warning about [Accessibility]Missing contentDescription attribute on image in eclipse. This warning show at line 5 (declare ImageView) in XML code below. This not make any error when build and run my application. But I really want to know…
PhatHV
  • 8,010
  • 6
  • 31
  • 40
242
votes
17 answers

Illegal string offset Warning PHP

I get a strange PHP error after updating my php version to 5.4.0-3. I have this array: Array ( [host] => 127.0.0.1 [port] => 11211 ) When I try to access it like this I get strange warnings print $memcachedConfig['host']; print…
thesonix
  • 3,200
  • 4
  • 20
  • 19
240
votes
16 answers

libpng warning: iCCP: known incorrect sRGB profile

I'm trying to load a PNG image using SDL but the program doesn't work and this error appears in the console libpng warning: iCCP: known incorrect sRGB profile Why does this warning appear? What should I do to solve this problem?
Omid Karami
  • 2,675
  • 2
  • 13
  • 17
237
votes
4 answers

How do I catch a numpy warning like it's an exception (not just for testing)?

I have to make a Lagrange polynomial in Python for a project I'm doing. I'm doing a barycentric style one to avoid using an explicit for-loop as opposed to a Newton's divided difference style one. The problem I have is that I need to catch a…
John K.
  • 2,473
  • 2
  • 13
  • 6
234
votes
1 answer

Disable all gcc warnings

I'm working on a project that will read compiler error messages of a particular variety and do useful things with them. The sample codebase I'm testing this on (a random open-source application), and hence rebuilding frequently, contains a few bits…
Phil Miller
  • 36,389
  • 13
  • 67
  • 90
229
votes
5 answers

How to find which promises are unhandled in Node.js UnhandledPromiseRejectionWarning?

Node.js from version 7 has async/await syntactic sugar for handling promises and now in my code the following warning comes up quite often: (node:11057) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):…
user1658162
  • 2,721
  • 2
  • 19
  • 23
222
votes
5 answers

How to suppress warnings globally in an R Script

I have a long R script that throws some warnings, which I can ignore. I could use suppressWarnings(expr) for single statements. But how can I suppress warnings in R globally? Is there an option for this?
Richi W
  • 3,534
  • 4
  • 20
  • 39
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