Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gustedt
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
gustedt
7mo ago
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 yet. If there is enough demand, `defer` may even happen for th
2.
▲
by
gustedt
1y ago
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.
▲
by
gustedt
1y ago
Randomly introduced translation errors from markdown to wordpress-internal should be fixed, now. Sorry for the incovenience!
4.
▲
by
gustedt
1y ago
The problem is that wordpress changes these things once you edit in some part. I will probably regenerate the whole.
5.
▲
by
gustedt
2y ago
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 notice that in that implementation there is an addition to the c
6.
▲
by
gustedt
2y ago
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 usually you should be able to have several actions, def
7.
▲
by
gustedt
2y ago
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 a new flow control feature. (And it is not new, o
8.
▲
by
gustedt
2y ago
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.
▲
by
gustedt
4y ago
Yes, `nullptr` will also be in C23.
10.
▲
by
gustedt
4y ago
Only that here we are talking about C. But yes, most C compilers already seem to have this as builtins.
11.
▲
by
gustedt
4y ago
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 the functions can even be ignored if the wrap around of the
12.
▲
by
gustedt
4y ago
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 sequence in putting the pointer parameter for the result first.