(credit to WaffleLapkin, BoxyUwU, m-ou-se, and Victoronz.)
At first glance, you'd think both are unsound. "Obviously" it's unsound to deference a null pointer. Even Claude 4 Opus with extended thinking agrees. Is that your final answer? Make up your mind now - spoilers below
(credit to WaffleLapkin, BoxyUwU, m-ou-se, and Victoronz.)
At first glance, you'd think both are unsound. "Obviously" it's unsound to deference a null pointer. Even Claude 4 Opus with extended thinking agrees. Is that your final answer? Make up your mind now - spoilers below
The code in one of these code samples is sound, and the other is not. Do you know which? (This is your chance to prove you're smarter than Claude and deserve to keep your job.)
The code in one of these code samples is sound, and the other is not. Do you know which? (This is your chance to prove you're smarter than Claude and deserve to keep your job.)
Let's do a few more for fun. I'm taking these examples from cppreference btw. What happens if you pass the largest possible signed integer to this function?
Let's do a few more for fun. I'm taking these examples from cppreference btw. What happens if you pass the largest possible signed integer to this function?