Question:
What is the difference between compiler error and compiler warning?
solid_rosas
2009-04-30 13:22:16 UTC
What is the difference between compiler error and compiler warning?
Four answers:
Egore
2009-04-30 13:30:03 UTC
A compiler warning message is informational information but will create the executable. An error will keep the compiler from creating an executable.
TBRMInsanity
2009-04-30 13:29:41 UTC
A compiler error is a section of your code that does not conform to the standard rules of the programming language (usually you misspelled something, or missed a ;). A compiler warming is something that will compile but may cause problems when you run the program. They include everything from infinite loops (a program that can never end), unused code (a section of code that will never be run), or possible side-effects may occur (a part of the program may have unforeseen effects on another part while it is running causing a computer crash).

It is a good idea to fix both errors and warnings as it makes your code more stable and easier to modify later on.
J.M.F.
2009-04-30 13:27:18 UTC
A compiler error is when a there is a problem with the code which means it is not possible to compile it - at least with current settings.



A compiler warning does not stop the compilation but alerts the programmer that the code is not following specific conventions
anonymous
2009-04-30 13:29:46 UTC
Mostly what the other person said. An error means your code cannot be processed but a warning says it doesn't like something but can process it.



The warning is usually something to take a close look at because often it will point out a potential error. You meant one thing but actually the code is going to do something else. You get side effects you don't expect.



I've always made it a standard rule to get rid of warnings also.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...