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
144
votes
31 answers

IntelliJ IDEA shows errors when using Spring's @Autowired annotation

IntelliJ IDEA is showing errors when I use Spring's @Autowired annotation in the class, but the class is functioning without any problem. Here is this error message: Autowired members must be defined in the valid spring bean…
Vainlyh
  • 1,615
  • 2
  • 12
  • 11
140
votes
3 answers

warnings.warn() vs. logging.warning()

What is the difference between warnings.warn() and logging.warn() in terms of what they do and how they should be used?
hekevintran
  • 22,822
  • 32
  • 111
  • 180
138
votes
9 answers

Visual C++: How to disable specific linker warnings?

I'm using a library from CGAL which during the linking stage of my code compilation produces a lot of linking warnings of this form: warning LNK4099: PDB 'vc80.pdb' was not found with 'gmp-vc80-mt-sgd.lib' or at 'vc80.pdb'; linking object as if no…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
138
votes
4 answers

Flags to enable thorough and verbose g++ warnings

Often in C under gcc, I will start with the following set of warning flags (painfully assembled from multiple sources): -Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wbad-function-cast \ -Wmissing-prototypes -Wstrict-prototypes…
Sdaz MacSkibbons
  • 27,668
  • 7
  • 32
  • 34
138
votes
11 answers

Data truncated for column?

After changing the data type of a MySql column in order to store Twilio call ids (34 char strings), I try to manually change the data in that column with: update calls set incoming_Cid='CA9321a83241035b4c3d3e7a4f7aa6970d' where…
Zagstrug
  • 1,669
  • 2
  • 11
  • 12
123
votes
3 answers

Breaking loop when "warnings()" appear in R

I am having an issue: I am running a loop to process multiple files. My matrices are enormous and therefore I often run out of memory if I am not careful. Is there a way to break out of a loop if any warnings are created? It just keeps…
mmann1123
  • 5,031
  • 7
  • 41
  • 49
119
votes
4 answers

relative path in require_once doesn't work

I have the following structure otsg > class > authentication.php > database.php > user.php > include > config.inc.php > encryption.php > include.php > session.php > index.php > registration.php include.php file has the…
user525146
  • 3,918
  • 14
  • 60
  • 103
118
votes
1 answer

How to resolve "Resource IDs will be non-final in Android Gradle Plugin version 5.0, avoid using them in switch case statements" warning?

@Override public void onClick(View v) { switch (v.getId()) { case R.id.legalInformationLL: startActivity(new Intent(AboutActivity.this, LegalInformation.class)); break; case R.id.backIB: …
Chaitanya Karmarkar
  • 1,425
  • 2
  • 7
  • 18
116
votes
6 answers

MIME type warning in chrome for png images

Just ran my site in chrome and suprisingly it comes up with this warning for each of my .png images: Resource interpreted as image but transferred with MIME type application/octet-stream. Anyone seen this before? Regards
Muleskinner
  • 14,150
  • 19
  • 58
  • 79
115
votes
5 answers

Why do I get a warning every time I use malloc?

If I use malloc in my code: int *x = malloc(sizeof(int)); I get this warning from gcc: new.c:7: warning: implicit declaration of function ‘malloc’ new.c:7: warning: incompatible implicit declaration of built-in function ‘malloc’
Kredns
  • 36,461
  • 52
  • 152
  • 203
111
votes
3 answers

Warning on "diff.renamelimit variable" when doing git push

I'm pushing the local commit to the remote git server and got the following warning messages: remote: warning: only found copies from modified paths due to too many files. remote: warning: you may want to set your diff.renamelimit variable to at…
stid.smth
  • 1,525
  • 2
  • 11
  • 11
111
votes
5 answers

How to remove the Xcode warning Apple Mach-O Linker Warning 'Pointer not aligned at address

I have a slight issue when build my Xcode project, get tones of warning after update pod. It looks like this Already search the whole site here but still no luck. it doesn't affect the project but it is quite annoying. Anyone could help?
Alexander Huang
  • 1,345
  • 2
  • 11
  • 16
110
votes
11 answers

Warning: "format not a string literal and no format arguments"

Since upgrading to the latest Xcode 3.2.1 and Snow Leopard, I've been getting the warning "format not a string literal and no format arguments" from the following code: NSError *error = nil; if (![self.managedObjectContext save:&error]) { …
Alexi Groove
  • 6,646
  • 12
  • 47
  • 54
107
votes
8 answers

'invalid value encountered in double_scalars' warning, possibly numpy

As I run my code I get these warnings, always in groups of four, sporadically. I have tried to locate the source by placing debug messages before and after certain statements to pin-point its origin. Warning: invalid value encountered in…
Theodor
  • 5,536
  • 15
  • 41
  • 55
107
votes
7 answers

How to use _CRT_SECURE_NO_WARNINGS

I have a compile error in my simple MFC window application generated from wizard with several lines of code: error C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use…
vico
  • 17,051
  • 45
  • 159
  • 315