Giter VIP home page Giter VIP logo

Comments (11)

ocornut avatar ocornut commented on May 14, 2024

Yes. This part of the code (.ini saving/loading) was tackled in and isn't very robust. Will have a look (or feel free to submit a patch).

from imgui.

elfring avatar elfring commented on May 14, 2024

Are you interested to apply aspect-oriented software development?
How do you think about to encapsulate error detection and corresponding exception handling as a reusable aspect in your software?

from imgui.

ocornut avatar ocornut commented on May 14, 2024

About the initial request. I have checked both LoadSettings and SaveSettings and haven't found a spot where additional meaningful error handling could be added. The return value to fread() is being used. In the unlikely case that fprintf() fails the following code can proceed happily.

Not interested in any change that would make the library less portable or carry more dependencies. Exceptions are disabled in many environment (embedded systems or game developpers typically disable exceptions in their compilers) and not a reasonable way of handling errors imho.

from imgui.

elfring avatar elfring commented on May 14, 2024
  • How do you think about to change the return type of functions like "LoadSettings" and "SaveSettings" to "int"?
  • Do you care if the passed data were completely written?
  • Would you like to check for failed memory allocations?

from imgui.

ocornut avatar ocornut commented on May 14, 2024
  • Not needed
  • No because the .ini file only saves window size/position as a commodity
  • Possibly need to check for them more thoroughly / but effectively they don't happen or recovery is not meaningful. ImGui is engineered for adhoc debug apps.

from imgui.

elfring avatar elfring commented on May 14, 2024

from imgui.

ocornut avatar ocornut commented on May 14, 2024

You've been ignoring our other discussions so I am now assuming you are a bot.

from imgui.

elfring avatar elfring commented on May 14, 2024

There are a few different opinions around the affected error handling.
To which discussions would you like to refer to?

from imgui.

ocornut avatar ocornut commented on May 14, 2024

Not using exceptions.

from imgui.

elfring avatar elfring commented on May 14, 2024

By which compiler parameters do you switch off the support for C++ exceptions here?
Is this an interesting implementation detail for your software portability?

from imgui.

ocornut avatar ocornut commented on May 14, 2024

I don't recall the exact parameters. Many embedded and console developers don't allow exceptions because they add extra overhead which can't be afforded.

from imgui.

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.