back
user profile
uecker
2,147karma·1,822submissions·April 14, 2020
about
Computational Magnetic Resonance Imaging, Real-time Magnetic Resonance Imaging, GCC Contributor, BART Toolbox, Member of ISO C WG14
recent activity (1,822 total)
comment
Not sure what you mean by "hacks to the type system". All modern computing essentially converged to unified memory, which is exactly C's model.
comment
This seems not entirely accurate. "malloc_usable_size" was only recommended for use for statistics before the change in man page: "Although the excess bytes can be overwritten by the a…
comment
Fair enough. It is just that got involved for similar reasons. I wanted certain things to work and nobody listened to me or fixed the bugs I filed. Now I know first hand what tremendous amount of work…
comment
About what are you talking exactly? What was actively broken?
comment
I think C is still a good choice for the following reasons:
- Performance is generally very good and while special languages can sometimes be better it usually easily possible to get the C code to the…
comment
I am salty that there is not a single library that is so good and well established that we could simply vote it into the standard.
comment
C can essentially do the same thing. I do not see why C++ would have a fundamental advantage here.
comment
You can do a lot though. And for many of the remaining things, such as all arithmetic UB, one can require run-time traps. The same for bounds checking (which will require some minor language extension…
comment
IIRC it was supported in C89 and described as implementation-defined and C99 changed the wording and mentions union type punning.
comment
Life would be much simpler for many us if people would stop complaining on internet forms and starting contributing to open-source or standardization efforts.
comment
They will, but glibc also has additional macro wrappers around certain library functions that do explicit checking based on __builtin_object_size or __builtin_dynamic_object_size. The code is public.…
comment
The can of worms is not so big actually. In general, observable behavior is only I/O and volatile accesses. This is not about side effects in general (which can be optimized according to the &quo…
comment
How would a compiler know the programmer's intent?
comment
I agree about the state of many things as you say and especially the point about more rigorous underpinning. But the flow of innovation and progress is not meant to come from ISO and flow to the compi…
comment
A compiler which compiles with a sanitizer can be perfectly conforming, i.e. faithfully compile a program.
comment
You can find the C standard for C23 here. https://www9.open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf (technically it is the draft for the next version, but o…
comment
Look at any C program. What are integers used for? Counting things, loop indexing, etc. These are all semantics of mathematical integers. Yes, it is an approximation that only works as integers do n…
comment
Yes, thanks. With C23 there are also now checked integers to do overflow checking for arithmetic operations.
comment
But ISO does not explicitly say anything like "it is ok to aggressively rewrite programs...". ISO C says, "xy is defined and z is not defined in the standard and then an implementatio…
comment
It does not need to be able to rely on having the behavior that causes the bug to be visible. We just need tools that make the bug visible, e.g. the undefined behavior sanitizers. Those tools work e…
comment
You realize that I am part of the standard's committee? ;-) I am programming C because Python is too slow for my use case (and too annoying and to unstable) and yes, I use C's integer types …
comment
What is consistent depend on the perspective. For me signed integers are a model for integers and overflow means that I exceeded the capabilities of the machine to model those correctly. Unsigned is…
comment
This is great. But why do you care about what that standard says? Making it UB in ISO C ensures that no portable program can rely on a specific behavior and this is what makes it possible to find bugs…
comment
It is non-normative note, as such it is to be understood as a clarification of what the standard already said before C23.
comment
Regarding signed overflow, I find it extremely useful that it is UB which allows me to instruct the compiler to insert a trap. This is very helpful to find bugs. For the same reason, the Linux kernel…
comment
I am trying my best. As a first step, C23^1 will have this clarification: "Note 3 to entry: Any other behavior during execution of a program is only affected as a direct consequence of the concre…
comment
Exactly.
comment
ISO C only specifies minimal requirements. It exists because people sit together and agree on those. If people do not agree we can not standardize it. We are also not the ones making your compiler m…
comment
Note that C++ has time-travel, C has not. A printf on a path which later encounters an operation with UB needs to be preserved.