Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uecker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
241.
▲
by
uecker
4mo ago
The check is removed only if you already dereference the pointer before doing the check. But then, you also get the trap before the check. So the compiler eliding the check is not making this worse - as long as the zero page is not mapped
242.
▲
by
uecker
4mo ago
Do you have any evidence for this? On GCC it should be safe. (EDIT: what is not safe is indexing into a null pointer. For this you need to be safe you need -fsanitize=null)
243.
▲
by
uecker
4mo ago
There can be made very good arguments why C is less safe than Rust, but null pointer dereferences which are perfectly safe everywhere except on weird platforms (and usually could be made safe even there by turning on a compiler flag) seems
244.
▲
by
uecker
4mo ago
While it is undefined behavior on the C standard level it a null pointer dereference is guaranteed to trap on most platforms.
245.
▲
by
uecker
4mo ago
You need to turn it off by defining NDEBUG. While sometimes it is not for release builds, I am not sure this is common.
246.
▲
by
uecker
4mo ago
The kernel is perhaps bit special. In the past they had bugs such as first derferencing and then checking for null and weird possibilities to map the zero page. But today I am not convinced this is really needed. In general on a system whe
247.
▲
by
uecker
4mo ago
The license is indeed the big reason for many proprietary forks (not so much that llvm is written in C++). This is not a good thing though.
248.
▲
by
uecker
4mo ago
The question is whether GCC is a good example of the benefits of C++ for compilers. Considering the code looks to 95% like C code and uses data structures that we originally implemented in C, I don't see this argument.
249.
▲
by
uecker
4mo ago
There is a difference between "needing a library" and "implement my own". One can just pick one. And even when implementing things yourself, one has to do this just once.
250.
▲
by
uecker
4mo ago
I think the fallacy of this argument is obvious.
251.
▲
by
uecker
4mo ago
How is this relevant? (also wider use for C I would doubt)
252.
▲
by
uecker
4mo ago
I was programming in C++ before switching to C and I would say that C++ adds a huge amount of mental load compared to C. I think one can understand how much of a relieve it is to not worry about everything C++ does only after not using C++
253.
▲
by
uecker
4mo ago
GCC was implemented in C and there are plenty of other C compilers written in C. GCC has been converted to C++ at some point, but large parts are still essentially C and I do not think the change to C++ was actually helpful (but others may
254.
▲
by
uecker
4mo ago
I personally like to use C and find Rust annoyingly complex. I think it may be an alternative to C++, but C++ is also too complex for my taste. I do not find it annoying to free several allocated structures when there is an error, but one
255.
▲
by
uecker
4mo ago
Or use a buffer abstraction in C. This is not exactly rocket science. The "this is impossible to prevent in C" nonsense does far more harm than good.
256.
▲
by
uecker
4mo ago
What convinced me that this is wishful thinking was CVE-2023-53156. Yes, it used "unsafe" but the wraparound in release defeated the manual check, and when you aim for performance comparable to C, Rust tends to be full of unsafe b
257.
▲
by
uecker
4mo ago
I guess official arch packages are also ok nowadays, my point was more that one should avoid non-curated repositories of packages such as cargo.
258.
▲
by
uecker
4mo ago
Yes, use a distro with good security posture such as Debian to reduce risk.
259.
▲
by
uecker
4mo ago
There was no caricature as a "AI follower" etc. I gave my arguments you didn't.
260.
▲
by
uecker
4mo ago
Your trumpet does not help and is just annoying.
261.
▲
by
uecker
4mo ago
There is nothing wrong with trying different things. But the fundamental problem here is that projects and their communities are social projects and need to be to fulfill their purposes and to ensure long term maintenance. In a free softwar
262.
▲
by
uecker
4mo ago
This has not much to do with skill. Standardization does not work like this, and I told you this before.
263.
▲
by
uecker
4mo ago
The support for variably modified types is excellent, if you discount MSVC which is lacking support for modern C anyway (it seems to catch up a bit though).
264.
▲
by
uecker
4mo ago
I think the risks of a rewrite - especially when using AI - are far more problematic than memory safety. In the long run those C projects will be memory safe in the next five years using memory safe C implementations.
265.
▲
by
uecker
4mo ago
They can still break stuff memory safely.
266.
▲
by
uecker
5mo ago
You are changing your argument. Let's first agree that my point that being able to use standard APIs (dup,close,pipe,...) is elegant and avoids having a lot of parameter for a process creation call.
267.
▲
by
uecker
5mo ago
As explained above, you fork and then before exec you can use all the usual APIs to close/duplicate/... file descriptors. This has no global impact on the parent process because you are already in the child, but one still has acce
268.
▲
by
uecker
5mo ago
I don't think it is hack. I think it is a nice and clean API and the hate is largely irrational. I think one could improve usability for multi-threaded programs though.
269.
▲
by
uecker
5mo ago
Define "hack".
270.
▲
by
uecker
5mo ago
I would prefer to continue to use elegant interfaces even beyond 2026.
More ›