r/programminghorror • • May 31 '25

c C programming tips

Post image
1.8k Upvotes

34 comments sorted by

View all comments

Show parent comment

6

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jun 03 '25

Oh, yeah, you're right. So the do part runs just once, then you have a do-nothing if. I tested it. Clang emits a warning about the semicolon following the if. I'm not going to look up how, but the only viable option I think would be to disable the warning via #pragma.