Menu

#25 Completion of error handling

closed
nobody
None
5
2015-10-20
2015-10-13
No

Would you like to add more error handling for return values from functions like the following?

Discussion

  • Ulya Trofimovich

    This code is in 'master', current active development branch is 'simplified_codegen' (this particular code has been removed a while ago).

    However, thank you for taking interest in re2c! Let me clarify current state of affairs (in order not to waste any of your time and effort).

    I'm looking forward to accept contributions (including helping, answering questions, working out common solutions, etc.). I'm glad to anyone who's willing to help.

    However, if you do want to help, you should put a lot of effort into understanding re2c problems and directions of work. Small and simple fixes (like the one with useless null pointer check) are ok, but general considerations (like C++ exceptions) are not useful at all --- they only distract me from work.

    Also please note that re2c is a small project and I constantly change the whole codebase, so you should keep in sync with the latest version.

    Hope that helps. :)

     
    • Markus Elfring

      Markus Elfring - 2015-10-14

      Small and simple fixes (…) are ok,

      Thanks for your acceptance.

      but general considerations (like C++ exceptions) are not useful at all

      I find this view strange.

      --- they only distract me from work.

      I hope that this situation can be improved somehow.

       
  • Ulya Trofimovich

    • status: open --> closed
     
    • Markus Elfring

      Markus Elfring - 2015-10-14

      I suggest to avoid ignorance of return values a bit more.
      Would you like to detect every error situation as early as possible?

       
  • Ulya Trofimovich

    Yes, of course I prefere to fix errors rather than ignore them. Do you have any suggestions where in particular I should check return value?

     
  • Ulya Trofimovich

    Hmm, what exactly do you expect re2c to do in all the above cases? Print a message and exit? (Note that in case of 'printf' failure printing a message may be a bad idea.) Maybe it should, however, it seems a minor issue to me (a very rare case).

    Please do understand me correctly. I'm working on important stuff right now: fixing all sorts of bugs, adding major features. I have a (rather) deep understanding of re2c structure. If don't rush at checking every unchecked return value, it's not because I don't know about it. It's because important stuff must be done first. By the time it is done half of the "issues" you are pointing to will not exist anymore.

    However, I don't mind accepting fixes even if I don't find them very helpful. Feel free to provide a patch!

    As for 'aspect-oriented programming', I don't find all these 'programming paradigms' of any help. I believe in writing code that solves exactly the problem you need to solve and does it in the simplest possible way.

     
    • Markus Elfring

      Markus Elfring - 2015-10-15

      How do you think about to indicate any more software failures in the program exit code?

      Would you like to delegate any more error checking to another dedicated development tool?

       
  • Ulya Trofimovich

    How do you think about to indicate any more software failures in the program exit code?
    Do you mean exit codes other than 0 (EXIT_SUCCESS) and 1 (EXIT_FAILURE) ?

    Would you like to delegate any more error checking to another dedicated development tool?
    Not sure, depends on the tool. :)

     
    • Markus Elfring

      Markus Elfring - 2015-10-16

      Do you mean exit codes other than …?

      Yes.

      Not sure, depends on the tool.

      How do you think about to integrate AspectC++ into your software development process?

       
      • Ulya Trofimovich

        Sorry for the delay in response, it took me some time to read the papers and manuals. (This article was really helpful; it clarified what AspectC++ is all about.)

        So, to the matter. AspectC++ is an interesting tool: the problem it tries to solve is non-trivial and the method looks promising. I'll keep an eye on it.

        However, I won't integrate it in re2c (not in the nearest future). re2c is not ideal in many ways, but error handling (as it seems to be the primary motivation of switching to AspectC++) is not a major issue. Also, re2c should stay small and portable (it should conform to C++-98).

        Thank you for your effort!

         
        • Markus Elfring

          Markus Elfring - 2015-10-19

          Would you like to improve error handling by more traditional C++ techniques?

           
  • Dan Nuffer

    Dan Nuffer - 2015-10-20

    Markus, there really isn't much that can go wrong with running re2c. It's quite a simple program. And the things that probably can go wrong, such as incorrect command line arguments are already handled.

     

Log in to post a comment.

MongoDB Logo MongoDB