GithubHelp home page GithubHelp logo

Completion of error handling about packcc HOT 11 CLOSED

arithy avatar arithy commented on July 17, 2024
Completion of error handling

from packcc.

Comments (11)

arithy avatar arithy commented on July 17, 2024

Thank you for your comment.
I introduced error handling wrapper functions also for fputs(), fprintf(), etc.
Please check out the branch 'develop'.

from packcc.

elfring avatar elfring commented on July 17, 2024

Thanks for your source code improvement.


🔮


from packcc.

arithy avatar arithy commented on July 17, 2024
  • Can a function like “perror” be helpful for your error reporting?

Partially yes, because it can print an errno message, but partially no, because it does not provide a formatting functionality like printf().
It needs some efforts to implement an error reporting function with an errno message printing feature, with a formatting functionality, and with portability.
Currently, I don't think errno message is so important for practical use.
So, I want to skip the efforts.

  • Can it make sense to move the deletion of files into an atexit() callback function?

I don't think atexit() is suitable for this case because file deletion is not required in normal situations.
I think it should be explicitly cared whenever context destruction.
Moreover, I dislike callbacks without custom arguments because it needs information passing via global variables.

  • Are you interested to apply aspect-oriented software development?
  • Would you like to encapsulate error detection and corresponding exception handling as a reusable aspect in this software?

In the context of packcc, sorry, I'm not interested.
I want to keep packcc compilable using a standard C compiler.

from packcc.

elfring avatar elfring commented on July 17, 2024

I think it should be explicitly cared whenever context destruction.

Would you like to improve exception handling another bit also for your software?

from packcc.

arithy avatar arithy commented on July 17, 2024

Yes in general, but no as for packcc.
I want to keep packcc as plain as possible.
I think complete exception handling mechanism in C brings unwanted complexity like longjump().
Such a mechanism is too much, considering that exceptional situations in packcc are very simple.

from packcc.

elfring avatar elfring commented on July 17, 2024

Does the mentioning of exception handling “distract” too much from further software development possibilities to complete the error handling finally?

from packcc.

arithy avatar arithy commented on July 17, 2024

I think error handling is quite important to software for practical use.
So, developers should make efforts to care exceptional cases.
However, in my opinion, the specifications of error handling may be as minimal as required to actual exceptional situations.
Since I want to keep PackCC as simple as possible, I don't adopt luxurious error handling which brings implementation complexity.

from packcc.

arithy avatar arithy commented on July 17, 2024

Anyway, can I close this issue?
I committed the requested feature to the branch master.

from packcc.

elfring avatar elfring commented on July 17, 2024

from packcc.

arithy avatar arithy commented on July 17, 2024

As I mentioned before, I'm not interested in aspect-oriented framework.

It might be an endless discussion, which seems not to be suitable on this issue board.
I want to quit answering to your questionnaire, OK?

from packcc.

arithy avatar arithy commented on July 17, 2024

As of the version 1.2.2, error handling features were added to all input and output functions.
I close this issue.

from packcc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.