« first day    last day (19 days later) » 

M.M
2:57 AM
Ouch, looks like Vlad got a 12 month ban for his frustrated responses
 
3:41 AM
If Vlad got banned then that is a shame and I'll see what I can do about getting him unbanned.
As for our UB discssion - https://stackoverflow.com/questions/6103822/on-undefined-behavior.
This is a very nice question and set of answers that sums up to:
1. UB is problematic and the recommended best practice is to avoid code leading to UB.
2. If you know for a fact that your code will only be targeting a specific architecture, compiler, and OS you can determine how UB will behave under that specific echo-system. Hence the pointer to char truncation example in my answer.
The most important point I am trying t make is this - based on the information which was provided by the OP it was possible to deduce what happens on a specific system, when a code example of UB was in question.
Keep in mind that the OP wanted to understand what happens since he was asked these questions during a job interview.
If he were to point out that this is UB then he would just show that he is a human compiler. But if he were to talk about the observed behavior, and mention that a pointer's value was truncated to fit a char type byte size, then he would have displayed a deeper under
human compiler -> human linter with a UB detection plugin ;)
 

« first day    last day (19 days later) »