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

Make javac treat warnings as errors

I have an Ant file that compiles my program. I want the javac task to fail if any warning was reported by the compiler. Any clue on how to do that?
Itay Maman
  • 30,277
  • 10
  • 88
  • 118
61
votes
2 answers

kotlin suppress warning deprecated for Android

In my Kotlin Android project, I am using a function that has been deprecated starting from api 23, which is quite recent. So I need a way to disable those deprecated warnings. Is there an easy way to do so?
loloof64
  • 5,252
  • 12
  • 41
  • 78
60
votes
2 answers

Treat all warnings as errors

This should be obvious to do, but I just couldn't make it work... What I'm trying to do is simple: I would like my compilation to fail with an error if there is a warning. Yes, the famous TreatWarningsAsErrors... I configured it in my C# project…
ken2k
  • 48,145
  • 10
  • 116
  • 176
60
votes
6 answers

Does python have a "use strict;" and "use warnings;" like in perl?

I am learning perl and python... at the same time, not my by design but it has to be done. Question: In a perl script I use(see below) at the head of my txt. #!/usr/bin/env perl use strict; use warnings; Is there something I should be doing on…
jon_shep
  • 1,363
  • 3
  • 15
  • 24
58
votes
5 answers

PHP Warning Permission denied (13) on session_start()

I'm getting the following error: PHP Warning: session_start() [function.session-start]: open(/tmp/sess_49a20cbe1ef09a2d0262b3f7eb842e7b, O_RDWR) failed: Permission denied (13) in…
Basic Bridge
  • 1,881
  • 4
  • 25
  • 37
57
votes
6 answers

Not targeting the latest versions of Android

I have a warning when trying to test theme on latest Android SDK Package 4.2. Here is my manifest file:
Edy Developer
  • 585
  • 1
  • 5
  • 5
56
votes
2 answers

Singleton release method produces warning?

In my singleton release method, I have it doing nothing: -(void) release { //A whole lot of nothing. } But it produces this warning: Warning: Conflicting distributed object modifiers on return type in implementation of 'release' I googled and saw…
Darkenor
  • 4,349
  • 8
  • 40
  • 67
56
votes
4 answers

Use new keyword if hiding was intended

I have the following snippet of code that's generating the "Use new keyword if hiding was intended" warning in VS2008: public double Foo(double param) { return base.Foo(param); } The Foo() function in the base class is protected and I want to…
Guy
  • 65,082
  • 97
  • 254
  • 325
56
votes
4 answers

How to find out where a Python Warning is from

I'm still kinda new with Python, using Pandas, and I've got some issues debugging my Python script. I've got the following warning message : [...]\pandas\core\index.py:756: UnicodeWarning: Unicode equal comparison failed to convert both arguments to…
Bonswouar
  • 1,521
  • 2
  • 17
  • 37
55
votes
9 answers

WARNING Not Found: /favicon.ico in Django

I'm new to Python and Django. I'm seeing this error message after I perform runserver, when trying to log in from my landing page, $ python manage.py runserver Running in development mode. Running in development mode. Running in development…
henghonglee
  • 1,732
  • 3
  • 20
  • 29
55
votes
1 answer

warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

very simple code does warn me. Some hints are not constructive. Warning is: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] I tried: char const *q = "pin"; char const *r = "\n\r"; { while(client.findUntil(*q, *r))…
realhanno
  • 577
  • 1
  • 4
  • 3
55
votes
3 answers

Why is it bad to use an iteration variable in a lambda expression

I was just writing some quick code and noticed this complier error Using the iteration variable in a lambda expression may have unexpected results. Instead, create a local variable within the loop and assign it the value of the iteration…
Nathan W
  • 54,475
  • 27
  • 99
  • 146
55
votes
4 answers

Print only the message on warnings

I'm issuing lots of warnings in a validator, and I'd like to suppress everything in stdout except the message that is supplied to warnings.warn(). I.e., now I see this: ./file.py:123: UserWarning: My looong warning message some Python code I'd like…
l0b0
  • 55,365
  • 30
  • 138
  • 223
55
votes
2 answers

How to deal with "exit-time destructor" warning in clang?

In my C++11 code I get the clang warning "Declaration requires an exit-time destructor" in the following case: static const std::map mymap = { {1, { "A", "B", "C" }}, {2, { "D", …
Lars Schneider
  • 5,530
  • 4
  • 33
  • 58
54
votes
4 answers

How to eliminate warning about ambiguity?

I have this warning: Warning 3 Ambiguity between method 'Microsoft.Office.Interop.Word._Application.Quit(ref object, ref object, ref object)' and non-method 'Microsoft.Office.Interop.Word.ApplicationEvents4_Event.Quit'. Using method group. on…