1

Hi recently I have been installing many of numerical software in Ubuntu.

Of the many software that I have installed manually using the make file provided, I have often seen that the compilation phase generates a number of warnings.

Are such compiler warning to be ignored? Many people tell me that warning don't really matter. I am confused. I want to be sure that I have installed a software correctly. Could anyone give me some sort of guidelines to which warnings I should ignore in general or which I should take seriously.

Many of the warnings I have seen involve some variable being initialized or the control reaching the end of a non-void function.

I am sorry if that sounds like a vague question. But I am not really sure how else to phrase it.

Thank you.

smilingbuddha
  • 14,334
  • 33
  • 112
  • 189
  • You can safely ignore all warnings. The only situation you need to care about is when compilation fails. Ubuntu's package manager will let you know when this happens, you don't have to pay any attention to the compiler's output. – user229044 Nov 13 '10 at 05:01
  • He's not using the package manager for this; he said he's building manually. – Matthew Flaschen Nov 13 '10 at 05:05

3 Answers3

4

Compiler warnings indicate things that might cause problems or might have unintended effects that the programmer wasn't aware of.

Different compilers warn more or less than others, and they all have options to increase or decrease the amount of warnings (type man gcc in the terminal to see what I mean).

Since I assume you're getting numerical software from open source projects that have been reviewed etc., there's no need for you to worry about the compiler warnings, because whoever coded it decided that the code was okay. When they first compiled it, they say the same warnings, and, probably, looked over them and said, "I see these warnings, but I can ignore them. Everything's okay." However, you may want to heed warnings when compiling your own code, depending on what that warning is.

Rafe Kettler
  • 75,757
  • 21
  • 156
  • 151
0

Warnings do often matter, but since you're not the developer, it's going to be almost impossible for you to find a bug that way. If it compiles successfully (no errors), you should be okay.

Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
0

Compiler warnings are there to tell you that there might be a problem with your code - they won't usually prevent your code from running correctly, but they help tell you where an issue might come up if you do experience one.

In your case, it could simply be that you're compiling code that was written to a slightly different standard - gcc will usually warn you depending on the compiler options if it notices something you might have overlooked, but it's possible to suppress these, and they aren't necessarily indicative of poor software quality.

If you don't have issues with the software, you probably don't need to worry about warnings.

user505255
  • 320
  • 1
  • 6