Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rseacord
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
rseacord
7y ago
None that I'm aware of.
32.
▲
by
rseacord
7y ago
My idea was to add something like the GoLang defer statement to C (as a function with some special compiler magic). The following is an example of how such a function could be used to cleanup allocated resources regardless of how a functio
33.
▲
by
rseacord
7y ago
Take a look at N2466 2020/02/09 Svoboda, Towards Integer Safety which has some support in the committee: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2466.pdf (signal is a strong word.
34.
▲
by
rseacord
7y ago
yes, that is correct.
35.
▲
by
rseacord
7y ago
There was a proposal for a checked integer type that you might want to look at: N2466 2020/02/09 Svoboda, Towards Integer Safety http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2466.pdf T
36.
▲
by
rseacord
7y ago
A full list of proposals to WG14 can be found here: http://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log... These papers are usually quite interesting.
37.
▲
by
rseacord
7y ago
Good question, but not at all! I've been working as hard as I can for the past 15 years to improve C Language security as have other security-minded members of the committee. Generally speaking, we are in the minority as performance i
38.
▲
by
rseacord
7y ago
I think we are always looking at ways to "clean up C" but that this has to be done very carefully not to break existing code. For example, the committee recently voted to remove support for function definitions with identifier lis
39.
▲
by
rseacord
7y ago
Maybe someone else can respond to this as well, but I feel like the primary reason signed overflow is still undefined behavior is because so many optimizations depend upon the undefined nature of signed integer overflow. My advice has alwa
40.
▲
by
rseacord
7y ago
I can't imagine it will ever be changed, since this would be a breaking change to the language.
41.
▲
by
rseacord
7y ago
I don't think we'll ever deprecate char, int, long, float, double, or size_t. ssize_t is not part of the C Standard, and hopefully never will be as it is a bit of an abomination. The main driver behind the evolution of the C Stan
42.
▲
by
rseacord
7y ago
C also has renewed interest around IoT programming and mobile devices
43.
▲
by
rseacord
7y ago
The results (from the minutes http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2377.pdf ) 6.33 Sebor, Add strnlen to C2X [N 2351] Result: No consensus on putting N2351 into C2X. 6.34 Sebor, Add stpc
44.
▲
by
rseacord
7y ago
There were a number of recent proposals to adopt various POSIX functions by Martin Sebor into C including: N2353 2019/03/17 Sebor, Add strdup and strndup to C2X N2352 2019/03/17 Sebor, Add stpcpy, and stpncpy to C2
45.
▲
by
rseacord
7y ago
No one has proposed making these standard. I doubt they would gain much support as they are similar to the Annex K Bounds Checked Interface functions strcpy_s and strcat_s but not quite as good IMHO.
46.
▲
by
rseacord
7y ago
I would say no, that we are still adding new features. Aaron Ballman was responsible for adding attributes to the C2x (he can tell you more). We're also looking at #embed feature to incorporate binaries the way that #include incorpora
47.
▲
by
rseacord
7y ago
C is a pretty well established language, so this question should probably be asked the other way around. C was primarily designed to complete with FORTRAN.
48.
▲
by
rseacord
7y ago
So what do people think about having a feature in the C language akin to the defer statement in GoLang? The GoLang defer statement defers the execution of a function until the surrounding function returns. The deferred call's arguments
49.
▲
by
rseacord
7y ago
It's a longish story, but people do seem to like the cover. We started equating the idea of C == Sea, so we had some early drawings of the robot riding various undersea creatures including a giant squid. I thought that looked overly p
50.
▲
by
rseacord
7y ago
Nothing to it! Just hit the reply button on comments you want to respond to. You can also upvote anything you like by clicking on the up arrow to the left of the comment.
51.
▲
Tell HN: C Experts Panel – Ask us anything about C
829 points
by
rseacord
7y ago
|
962 comments
52.
▲
by
rseacord
7y ago
So there are many ideas here. I commented separately that I would be happy to help members of the community develop quality proposals and champion these to the committee. You can look here http://www.open-std.org/jtc1/
53.
▲
by
rseacord
7y ago
This is an interesting coincidence, because I just started drafting a 'defer' paper. In general, this is not an abuse of my position. I would be happy to collaborate with you (or anyone else in the community) to develop papers an