Five Awesome C++ Papers for the H1 2023 - C++26, Varna and More
https://www.cppstories.com/2023/h1-cpp-papers23/
https://redd.it/14dmger
@r_cpp
https://www.cppstories.com/2023/h1-cpp-papers23/
https://redd.it/14dmger
@r_cpp
C++ Stories
Five Awesome C++ Papers for the H1 2023 - C++26, Varna and More
Last week the ISO committee met in Varna to discuss some of the first batch of C++26 features. It’s an excellent occasion to shed some light on the latest status and interesting C++ proposals.
Let’s start!
By the way: This will be my first blog post with…
Let’s start!
By the way: This will be my first blog post with…
C++26 ends a 40-year footgun
Reading an uninitialized variable has been undefined behavior in C++ for 40 years -- the kind optimizers exploit into real bugs. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still warned about, but defined, bounded, and not exploitable.
The demo poisons the stack, then reads an uninitialized int. As C++23 it prints garbage; as C++26, the same code prints a defined 0, every run. Live in your browser.
And [[indeterminate\]\] lets you opt back out when you really want an uninitialized buffer -- on purpose this time.
Read it: https://wrocpp.github.io/posts/erroneous-behavior/?utm_source=reddit&utm_medium=social&utm_campaign=post-erroneous-behavior
\#cpp #cplusplus #cpp26 #safety #programming
https://redd.it/1uo5y63
@r_cpp
Reading an uninitialized variable has been undefined behavior in C++ for 40 years -- the kind optimizers exploit into real bugs. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still warned about, but defined, bounded, and not exploitable.
The demo poisons the stack, then reads an uninitialized int. As C++23 it prints garbage; as C++26, the same code prints a defined 0, every run. Live in your browser.
And [[indeterminate\]\] lets you opt back out when you really want an uninitialized buffer -- on purpose this time.
Read it: https://wrocpp.github.io/posts/erroneous-behavior/?utm_source=reddit&utm_medium=social&utm_campaign=post-erroneous-behavior
\#cpp #cplusplus #cpp26 #safety #programming
https://redd.it/1uo5y63
@r_cpp
wrocpp.github.io
C++26 ends a 40-year footgun: uninitialized reads
Reading an uninitialized variable has been undefined behavior in C++ for four decades, and optimizers have happily exploited it. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still diagnosed, but with defined, bounded, non-exploitable…