Live data from Hacker News

Viewing profile — gustedt

gustedt

HN member
Joined
Mon, Dec 14, 2020, 9:02 PM UTC
HN karma
26
Public activity
18 items

About gustedt

No profile information was provided.

Recent public activity

  1. comment
    Comment #47045410

    Thanks! In fact, the standard reflects what is happening in the field. So, use `defer` where this is already possible and ping your compiler vendor for those that do not have it ye…

  2. comment
    Comment #45180889

    That may be true in your bubble, but I don't think this is true in general. There are still a lot C compilers out there, compared to 3 or 4 that do C++.

  3. comment
    Comment #44426876

    Randomly introduced translation errors from markdown to wordpress-internal should be fixed, now. Sorry for the incovenience!

  4. comment
    Comment #44425759

    The problem is that wordpress changes these things once you edit in some part. I will probably regenerate the whole.

  5. comment
    Comment #41565609

    Thanks for the pointer! Definitively, on the long run these things should go into compilers directly, yes. BTW, the break continue stuff now works in the development branch. I noti…

  6. comment
    Comment #41557360

    This would be much more restrictive that what is proposed, because usually you would add `defer` statements as you go in a block, when you allocate more resources for example. Also…

  7. comment
    Comment #41556316

    That's not very practical if you have several operations to perform, you'd have to create a specialized function each time. So no, that extension is not an alternative to designing…

  8. comment
    Comment #41556235

    Yes, the visibility rules for variables remain exactly the same. The dependent statement of a defer lives in the same scope as the defer is placed.

  9. comment
    Comment #34057909

    Yes, `nullptr` will also be in C23.

  10. comment
    Comment #34057762

    Only that here we are talking about C. But yes, most C compilers already seem to have this as builtins.

  11. comment
    Comment #34057753

    Besides C not having exceptions (that you could catch), the point was and is to have a way such that such a call has defined behaviour under any circumstances. The return value of …

  12. comment
    Comment #34057700

    Unfortunately there are several error conventions in the C standard. Here, the committee just standardized existing practice, namely the gcc builtins. We just adjusted the call seq…

  13. comment
    Comment #25436015

    In the current proposal, the whole function body can act as a guarded block. So for simple cleanup strategies that are bound to functions, you wouldn't need this.

  14. comment
    Comment #25423613

    No, actually none of that. That code has a constraint violation: it uses the variable i outside of its scope. Even if i would be declared on the same level as the guard, this seque…

  15. comment
    Comment #25423540

    That is effectively one of the options that is under discussion. One of the advantage of the approach with defer is really that everything happens in the open and all uses that one…

  16. comment
    Comment #25423494

    IIRC in C++ this is only so if there is a try/catch underneath.

  17. comment
    Comment #25423379

    In the contrary, I find it really weird to bind all cleanup code to some kind of object with constructors and destructors. People seem to have gotten so used to this ... I think th…

  18. comment
    Comment #25423311

    Just use the reference implementation that is linked in the post. We would much appreciate feedback from users at this point.