Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sankar435
    New Member
    • May 2007
    • 3

    Error

    What Is The Difference Between A Compile Time Error And Run Time Error

    Plz Help
    Thanks
  • AdrianH
    Recognized Expert Top Contributor
    • Feb 2007
    • 1251

    #2
    Originally posted by sankar435
    What Is The Difference Between A Compile Time Error And Run Time Error

    Plz Help
    Thanks
    Just like it sounds. A compile time error happens at compile time. A run time error happens at run time (when you execute the code you have compiled).


    Adrian

    Comment

    • sankar435
      New Member
      • May 2007
      • 3

      #3
      Originally posted by AdrianH
      Just like it sounds. A compile time error happens at compile time. A run time error happens at run time (when you execute the code you have compiled).


      Adrian
      so is compile time error the mistakes that we make while writing a program that is the syntax.

      Comment

      • Savage
        Recognized Expert Top Contributor
        • Feb 2007
        • 1759

        #4
        Originally posted by sankar435
        so is compile time error the mistakes that we make while writing a program that is the syntax.
        Yes,they are syntax errors

        Savage

        Comment

        • svlsr2000
          Recognized Expert New Member
          • Feb 2007
          • 181

          #5
          Compile time errors indicate syntax errors, and other violation we might do while coding. This would just stop the compiler from generating proper binaries for us.

          Run time errors occur during execution of program. Run time errors indicate bugs in program. We can consider running out of memory as runtime error.

          Run time error is different from crashing.

          Comment

          • nearestniladri2003
            New Member
            • May 2007
            • 11

            #6
            Each and every time we write a code, that is verified by the compiler generated syntax & semantics tree. Which part does not match with the tree, compiler throws an error.... This is known as compilation time error / syntactic error.
            The runtime errors are the errors, which are generated by the environment, or the logical errors as divided by zero error. The runtime errors, which are generated by the operating system, are like Lvalue required or memory allocation errors.
            If you have more quarries then I recommend you to go through any Compiler design books as book by Aho, Ulman etc.

            Comment

            • AdrianH
              Recognized Expert Top Contributor
              • Feb 2007
              • 1251

              #7
              Originally posted by svlsr2000
              Run time error is different from crashing.
              I disagree. Crashing is like any other programming bug caused by the programmer writing something that is syntactically correct, but violates some logical rule such as dereferencing a NULL pointer (a very simple example).

              The only difference between crashing and not crashing is that the user is aware of the problem immediately and may loose data, whereas in the latter case, they are unaware of the problem and may get corrupted data.

              Personally, I prefer crashing as to not (at least when I am debugging ;)) as it tells me immediately that I’ve done something wrong.


              Adrian

              Comment

              • AdrianH
                Recognized Expert Top Contributor
                • Feb 2007
                • 1251

                #8
                Originally posted by nearestniladri2 003
                Each and every time we write a code, that is verified by the compiler generated syntax & semantics tree. Which part does not match with the tree, compiler throws an error.... This is known as compilation time error / syntactic error.
                A bit technical but essentially correct.

                Originally posted by nearestniladri2 003
                The runtime errors are the errors, which are generated by the environment, or the logical errors as divided by zero error.
                Correct.

                Originally posted by nearestniladri2 003
                The runtime errors, which are generated by the operating system, are like Lvalue required or memory allocation errors.
                Lvalue required is a compile time error. But you are right in that memory allocation is a runtime error.

                Basically, anything that gets through the compile and results in a programme not behaving as expected is a runtime error. Depending on its severity, the user may see nothing apparently wrong, see it crash, or may even see the words “runtime error” or other phrase indicating that the framework in the code generated was able to catch the problem just in time to emit some message.

                Further, a failed assertion is also considered a runtime error. They give you some info as to what just happened. Unfortunately, sometime they don’t give you enough context.


                Adrian

                Comment

                • svlsr2000
                  Recognized Expert New Member
                  • Feb 2007
                  • 181

                  #9
                  Originally posted by AdrianH
                  I disagree. Crashing is like any other programming bug caused by the programmer writing something that is syntactically correct, but violates some logical rule such as dereferencing a NULL pointer (a very simple example).

                  The only difference between crashing and not crashing is that the user is aware of the problem immediately and may loose data, whereas in the latter case, they are unaware of the problem and may get corrupted data.

                  Personally, I prefer crashing as to not (at least when I am debugging ;)) as it tells me immediately that I’ve done something wrong.


                  Adrian
                  The difference between [font=Verdana][size=2]runtime errors and crashes is that we can often recover gracefully from a runtime error.[/size][/font]
                  [font=Verdana][size=2]There is one category of error called Bomb.[/size][/font]
                  [font=Verdana][size=2]The term bomb usually refers to a program hanging or ending prematurely. Bombing refers to a single program, whereas crashing refers to the entire system. [/size][/font]

                  Comment

                  • AdrianH
                    Recognized Expert Top Contributor
                    • Feb 2007
                    • 1251

                    #10
                    Originally posted by svlsr2000
                    The difference between [font=Verdana][size=2]runtime errors and crashes is that we can often recover gracefully from a runtime error.[/size][/font]
                    [font=Verdana][size=2]There is one category of error called Bomb.[/size][/font]
                    [font=Verdana][size=2]The term bomb usually refers to a program hanging or ending prematurely. Bombing refers to a single program, whereas crashing refers to the entire system. [/size][/font]
                    Err, the tags on this forum are not equivalent to html tags. ;)

                    I also still do not completely agree with your statement. Though there may be different classifications of runtime errors; a runtime error is generally just what is describes, an error occurring at runtime, be it a crash, a bug, or something that is exceptional (see exception handling). Catching a runtime error may be possible for a graceful recovery, but is not mandatory.

                    Further, if the ‘error’ is caught and fixed, it may not be considered an error in the same sense, as you have created a valid state for it by providing a recovery (probably why C++ uses the term exception handling not error handling).

                    Adrian

                    Comment

                    Working...