Maybe that's just C++, but I've heard that redefining keywords is UB. Though that might've been if any standard library headers are included after redefining a keyword.
Yeah, C++ apparently explicitly mentions this to be UB (redefining a keyword when you are including headers). C doesn't AFAIK, and in both redefining keywords itself is not directly problematic. (similar to how int x; itself is not problematic - it's only problematic if you don't assign a value before accessing it)
View all comments
Show parent comment
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Mar 25 '26
Maybe that's just C++, but I've heard that redefining keywords is UB. Though that might've been if any standard library headers are included after redefining a keyword.