I’m not great with gdb but I think using the x cmd shows them.
coder
I’m not great with gdb but I think using the x cmd shows them.
Your result is correct, is just not displaying the leading zeros.
The problem is that if you send a message just blindly, you can be tricked into sending spam to millions of addresses. I do one thing that prevents that, but does violate the standard, I verify there’s only 1 ‘@’ in the address… this technically prevents people with '@'s in their name, but they probably find it impossible to do anything with that address anyway.
What are you talking about? Compilers can and do flag undefined behavior as errors. I recommend you read up on the documentation of any compiler.
And I recommend you read Chris Latter’s essay on UB.
https://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html
Where he gives plenty of examples of UB resulting in the compiler optimizing away safety and introducing security vulnerabilities silently. In part 3 he discusses the efforts clang has made to improve on this.
He then went on to make Swift and says this: “Undefined behavior is the enemy of safety, and developer mistakes should be caught before software is in production.”
and
“UB is an inseperable part of C programming, […] this is a depressing and faintly terrifying thing. The tooling built around the C family of languages helps make the situation less bad, but it is still pretty bad. The only solution is to move to new programming languages that dont inherit the problem of C.”
It violates the principle of least surprise. You don’t expect the compiler to delete your bounds checking etc.
The way c and c++ define and use UB is like finding an error at compile time and instead of reporting it, the compiler decides to exploit it.
Should focus on getting rid of undefined behavior.
My problem with C/C++ is the people behind the spec have sacrificed our sanity in the name of “compiler optimization”. Signed overflow behaves the same on every cpu on the planet, why is it undefined behaviour? Even more insane, they specify intN_t
must be implemented via 2s complement… but signed overflow is still undefined because compilers want to pretend they run on pixie dust instead of real hardware.
And yet it’s still easy to write spaghetti code in Java. Just abuse inheritance. Where is this function implemented? No one knows but the compiler!