answersLogoWhite

0


Best Answer

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

    14y ago
    This answer is:
    User Avatar
    More answers
    User Avatar

    Wiki User

    14y ago

    The compiler can detect all kinds of syntactical errors like:

    • referring to a method that doesnt exist
    • assigning objects of one type to another without explicit casting
    • trying to access private methods of another class
    • etc.

    The purpose of the compiler is to detect these kind of programming problems in the code.

    This answer is:
    User Avatar

    User Avatar

    Wiki User

    11y ago

    Linker errors. When you got those errors you forgot to include a library or a header file, which contains functions used in your program.

    This answer is:
    User Avatar

    Add your answer:

    Earn +20 pts
    Q: What type of errors are reported by the compiler?
    Write your answer...
    Submit
    Still have questions?
    magnify glass
    imp
    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.


    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.


    What will uncover any syntax errors in your program?

    The compiler


    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.


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

    Obama


    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.


    Do bugs always result from programming error?

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


    What are the type of compiler?

    peace out yeah that's right!


    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.


    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.