C++Now 2025 SESSION ANNOUNCEMENT: Undefined Behavior From the Compiler’s Perspective by Shachar Shemesh
https://schedule.cppnow.org/session/2025/undefined-behavior-from-the-compilers-perspective/
Register now at https://cppnow.org/registration/
C++Now 2025 SESSION ANNOUNCEMENT: Undefined Behavior From the Compiler’s Perspective by Shachar Shemesh
https://schedule.cppnow.org/session/2025/undefined-behavior-from-the-compilers-perspective/
Register now at https://cppnow.org/registration/
C++Now 2025 SESSION ANNOUNCEMENT: Undefined Behavior From the Compiler’s Perspective by Shachar Shemesh
https://schedule.cppnow.org/session/2025/undefined-behavior-from-the-compilers-perspective/
Register now at https://cppnow.org/registration/
I personnally never count upon miracle segfaults to detect errors, as it is simply Undefined Behaviour #undefinedbehaviour in C/C++, so you cannot know what happens in such cases.
But you are right, often you can get segfaults to indicate you early that a corruption is happening.
It remains a powerful technique for optimizing speed. Often, one cannot gain on every level ;-)
I was just talking about it. It is not a recommended way to do it.
If your allocation is not in a bottleneck, it is a fuss you don't have to worry about.
I rather got a chuckle out of this #LWN article, which can sort of be summarized as "CPU architectures involving time-travel result in undefined behaviour".
https://lwn.net/Articles/993484/
#TimeTravel #MemoryModel #C #programming #C++ #UndefinedBehaviour
Lightning Talk: Undefined Behaviour in C++ – Cassio Neri – C++ on Sea 2023
https://www.youtube.com/watch?v=YD3rI0Z1hYo
#coding #cplusplus #cpp #lightningtalk #programming #softwareengineering #undefinedbehaviour
This is the most C++ thing I've ever seen.
@jfbastien
#Cpp #UndefinedBehaviour
https://www.youtube.com/watch?v=e-Gl_x1XDiY
Falsehoods programmers believe about undefined behaviour, https://predr.ag/blog/falsehoods-programmers-believe-about-undefined-behavior/.
The article explains what is an undefined behaviour exactly. It’s funny.
The basic problem with C is that the committee have been asleep at the wheel for 30 years. As soon as UB began to be interpreted as "the compiler will now do impossible things" they should have stepped in and said "actually we mean that _some value_ is produced, but we do not care to specify what" (or a trap is raised, to keep SGI on board). That covers arithmetic anyway.
Sure for pointers and longjmp you do need "truly undefined", but even that could be profiled.
1/
“For all the talk C programmers love to make about how ‘close to the metal’ they are, they never really were. — @thephd https://thephd.dev/c-undefined-behavior-and-the-sledgehammer-guideline #cProgramming #cLanguage #cplusplus #cpplang #programming #systemsProgramming #abstractMachine #undefinedBehavior #undefinedBehaviour
›They Have Played Us #Programmer|s for Absolute #Fool|s‹
🧷 https://www.youtube.com/watch?v=QTiAWZ1YfzI&t=217s
🌺
🏷️ #Lisp #Scheme #CommonLisp #CPP #Rust #DennisRitchie #BrianKernighan #BjarneStroustrup #CLang #Rustacean #MetaProgramming #Risitas #JohnMcCarthy #Unix #Pipes #Segfault #NullPointer #UndefinedBehaviour #GarbageCollection #MemoryManagement #BellLabs #ObjectSystem #FunctionalProgramming #Syntax #Rustaceans #MemorySafety #ElRisitas #CLOS #AMOP
My problem with undefined behavior, isn't that there are things in C/C++ you can't do. Every programming language has things you can't do.
My problem is that the compiler and runtime isn't required to tell you that you're not allowed to do it.
Indeed, some forms of UB don't appear to be suspicious at all. A programmer would be forgiven to think they are allowed by the language.
And then when the program breaks we call that human error, but it is, in reality, bad design, to borrow an idea from Don Norman.
It's like a push-only door that's labelled "pull"!
#normanDoors #programming #cprogramming #cpplang #cplusplus #design #undefinedbehavior #undefinedbehaviour