answersLogoWhite

0

That depends on the language, and in part on the compiler. A good compiler can find lots of different errors, for example:

  • A variable that is used before being declared.
    • Type incompatibility.
    • A variable is used that hasn't been assigned a value before. (This would mean that any garbage that happened to be at that position in memory would be used, instead of using a known value.)
    • A variable is assigned a value, but that variable is never used. This would usually be only a warning - nothing bad would happen, but some lines in your program would be superfluous.
    • Array out of bounds - for example, an array has 5 elements, numbered 0-4, and you are trying to access element #5, or element # minus 1.
    • A mismatch between open and close parentheses, braces, if/endif, etc.
    • A function or method has been declared to return a certain data type, but in the return statement you return a different data type - or no data at all.

      And many more. If you do some programming, you will soon see the compiler catching all kinds of mistakes.

  • User Avatar

    Wiki User

    15y ago

    What else can I help you with?

    Related Questions

    What type of error can not be detected by the compiler?

    Most commonly this would be a logical error, such as coding an incorrect calculation. However, depending on the compiler and language, other errors may not be detected at compile time.


    What will uncover any syntax errors in your program?

    The compiler


    Why wont your C plus plus programs compile?

    C++ programs won't compile if they contain compiler errors. The compiler will tell you precisely where the error is, and the type of error, unless the error is in a macro. The compiler cannot see macro definitions because they are inline expanded prior to compilation.


    Grace Murry Hopper Invented the compiler and was reported to find the first bug in a relay-what did she do with it?

    Obama


    Will the java compiler translate a source file that contains syntax errors?

    No it will not. Any java source file that has syntax errors will not be translated fully. The compiler will spit out errors based on the syntax problems in your code.


    Can a compiler detect runtime errors?

    No, it would require divination.


    When does a program show a compiling error?

    When a program contains a compiler error, the compiler will detect it, preventing the program from compiling. Compiler errors must be fixed before a program will compile successfully.


    What are the drawbacks to c compiler?

    It cannot automatically correct the errors of the source program.


    What are the type of compiler?

    peace out yeah that's right!


    Do bugs always result from programming error?

    No,It might also be due to compiler errors which result in unnecessary display of errors


    What is a dictionary compiler called?

    A program that compiles dictionaries is commonly known as a lexicographic compiler or a glossary compiler. This type of software helps to organize and format data into dictionary entries for various purposes.


    What Errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error?

    Run time errors or syntax errors are most easy to locate, since the compiler will show you where the errors are. A logic error would be more difficult to locate, since the program runs but does not compute the desired result.