back
user profile

uecker

2,141karma·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
I use X remoting every day. Being told that I do not need it and it would not work anyway, is what makes me angry. Then I hate that decades of protocol compatibility are broken, which i think is sad …
2y ago·view thread
comment
There were C implementations with bounds checking or implementations that trap on use of an invalid pointer or on read of uninitialized variables etc. A large part of UB was introduced for such rea…
3y ago·view thread
comment
Two's complement does not mean signed overflow became defined. So the check is still wrong. And no, I do not think making it defined would lead to more correct programs. You then simply have real…
3y ago·view thread
comment
It should be "C and C++ Implementations" because nothing in the standard requires UB to be exploited for optimization instead of adding run-time checks.
3y ago·view thread
comment
There are plenty of similar things in C++. I do not think C++ is safer than C. std::vector does not do bounds by default checking last time I checked.
3y ago·view thread
comment
Note that not all claims you find about UB on the internet are true. For example, in C, UB can not time-travel before observable behavior. And in general UB can not time-travel before any function ca…
3y ago·view thread
comment
Well, the argument brought up is that users want it this way, so this is existing practice which is implemented and should be standardized. So please complain and file bugs. Also use the compiler and …
3y ago·view thread
comment
I agree there should be a warning. But it is not trivial to teach a compiler when to warn or not to not generate too many false positives. Not as good as warning, but UBSan catches this at run-time: …
3y ago·view thread
comment
I think C is a perfectly fine language for modern projects and one can write good software with it. In fact, most software I use on daily basis is written C and extremely reliable: Linux, git, xcfe, t…
3y ago·view thread
comment
What "best evidence"? I find it strange that coal deaths from air pollution predicted by epidemiological considerations is taken for granted while similar predictions for nuclear from uncont…
3y ago·view thread
comment
I would say that calling this a "hydroelectric catastrophe" is misleading. The main motivation for building this dam was apparently to control flooding.
3y ago·view thread
comment
We will see. In a regulatory context, "the implementation is the spec" usually does not convince.
3y ago·view thread
comment
We will make VM-types, i.e. pointers to VLAs, mandatory in C23.
3y ago·view thread
comment
You need to pass a pointer to an array: https://godbolt.org/z/jYzY79ac4 When passing an array it decays into a pointer and the size is lost. We can also change sizeof to recover…
3y ago·view thread
comment
These are dependent types which C++ does not have at all. The C support is fairly weak though... But most programming language people I know agree that dependent types are they way to guard against o…
3y ago·view thread
comment
You may be interested in this: https://github.com/uecker/noplate.git
3y ago·view thread
comment
See also here for my experiments, but it relies on UBSan for bounds checking: https://github.com/uecker/noplate.git …
3y ago·view thread
comment
Sure, you could also put a lot of complicated macros into headers. But in practice it is not a problem because this is not how you would do it in C. But in C++ you put the definition of a class into t…
3y ago·view thread
comment
That the size is information is used more for checking is generally ongoing work. Inside a function it can be propagated by the compiler. The old GCC extension can also be hidden behind a macro, so t…
3y ago·view thread
comment
The freeze is in effect, but issues can still be addressed with NB comments. There was a NB related to this topic and WG14 asked me to create a new revision of this paper.
3y ago·view thread
comment
g is UB which is why one can use it easily for checking. h is fine because a is larger than 7. If it were smaller the call could be diagnosed. If you overwrite the pointer inside the function, then th…
3y ago·view thread
comment
While most C compilers ignore this the size in C can definitely be used for checking and this is intended, e.g. see the C2X charter: https://www.open-std.org/jtc1/sc22/wg14&#…
3y ago·view thread
comment
I do not think security was an issue at this time. I assume you mean this proposal: https://www.bell-labs.com/usr/dmr/www/vararray.pdf I like it and it is on my list t…
3y ago·view thread
comment
A a C programmer, I think Rust got memory correctness right. Unfortunately, I do not like the rest of the language ;-(
3y ago·view thread
comment
WG14 can still vote it into C23.
3y ago·view thread
comment
In C headers are not a problem. They are simple and effective. C++ made the mistake of putting implementations into headers for generic programming.
3y ago·view thread
comment
Yes, and with pointer-to-array syntax the bounds checking already works today: https://godbolt.org/z/oc6MTWjYd For your syntax we will probably just also add it is an option.…
3y ago·view thread
comment
Did you try inline as well? Why are they not as flexible as the macro? Couldn't the swap not also process two arrays?
3y ago·view thread
comment
What is wrong with promoting unsigned short to int?
3y ago·view thread
comment
Why? I do not find the wording in the C standard less clear than the C++ wording (where the result is unspecified for unrelated pointers).
3y ago·view thread