What's up with `strlcpy` and `strlcat`? Are they getting standardized?
We've been considering proposals to add common POSIX APIs into C, but I don't believe we've seen a proposal for strlcpy or strlcat yet. I recall we agreed to add strdup to C given its wide availability and usage.
Tell HN: C Experts Panel – Ask us anything about C
111–120 of 978 posts
Re: Tell HN: C Experts Panel – Ask us anything about C
#112What is the story behind the removal of VLAs from C99 in later revisions?
What removal? C11 section 6.7.6.2 specifies the semantics.
Re: Tell HN: C Experts Panel – Ask us anything about C
#113Re: Tell HN: C Experts Panel – Ask us anything about C
#114Re: Tell HN: C Experts Panel – Ask us anything about C
#115Earlier quoted context omitted.
In my opinion, the two languages are going to co-exist for a long time. C has billions of lines of legacy software written in it… In recent news, COBOL developers were sought after in order to update existing COBOL software, so the same thing will happen with C, perhaps to the end of humanity (I have become pessimistic as to humanity's future). There are pieces of software that should be given priority for a rewrite…
There's tons of legacy C around, we have to maintain it, it's not ideal unless you're on some niche platform, lots of stuff should probably be written in a better language . . . I sincerely hope this is not the general attitude of the standards committee. Some of us actually prefer C, and would like to see the language continue to flourish.
Re: Tell HN: C Experts Panel – Ask us anything about C
#116Earlier quoted context omitted.
In BRL's MUVES project, we used a 2-character prefix indicating category. E.g., all the external identifiers for our fancy memory allocator began with "Mm", where Mm.h documented the interface for the Mm package only. To minimize the external identifiers, one could make just the name of a container structure the sole entry access handle, with structure members pointing to the functions. Then use it like: #include if…
Tip: you can use four leading spaces to write code. Like this
Re: Tell HN: C Experts Panel – Ask us anything about C
#117Re: Tell HN: C Experts Panel – Ask us anything about C
#118Are there any plans to "clean up C"? A lot of effort has been put into alternative languages, which are great, but there is still a lot of momentum with C, and it seems that a lot of improvements that could be done in a backwards compatible way and without introducing much in the way of complexity. For example: - Locking down some categories of "undefined behaviour" to be "implementation defined" instead. - Proper ar…
There are efforts to define the behavior in cases where implementations have converged or died out (e.g., twos complement, shifting into the sign bit).
There have been no proposals to add new array types and it doesn't seem likely at the core language level. C's charter is to standardize existing practice (as opposed to invent new features), and no such feature has emerged in practice. Same for modules. (C++ takes a very different approach.)
Re: Tell HN: C Experts Panel – Ask us anything about C
#119Are there any plans to "clean up C"? A lot of effort has been put into alternative languages, which are great, but there is still a lot of momentum with C, and it seems that a lot of improvements that could be done in a backwards compatible way and without introducing much in the way of complexity. For example: - Locking down some categories of "undefined behaviour" to be "implementation defined" instead. - Proper ar…
Undefined behaviors tend to be undefined for a reason and shouldn't be thought of as defects in the standard. In my years on the committee, I have always argued to define as much behavior as possible and to as narrowly define undefined behaviors as possible.
We also had a recent discussion about adding additional name spaces (when discussing reserved identifiers), but it didn't gain much traction.
Re: Tell HN: C Experts Panel – Ask us anything about C
#120Hi I took an amazing course in college that focused heavily on C. Do you have any recent examples of small side projects you’ve worked on using C?