I accidentally passed an integer instead of a pointer to a function. It compiled fine, no compiler warnings. It didn't even crash at runtime. It just didn't work.

Why?

Because the integer was a complex nested macro constant, including integer type casts, bit shifting, and masking, but in the end it resolved to...

zero.

Which is just a normal NULL pointer, not even UB, not even a compile warning.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://vt.social/users/lina/statuses/115941679924757605 on your instance and quote it. (Note that quoting is not supported in Mastodon.)