logoalt Hacker News

jacquesmyesterday at 11:32 PM1 replyview on HN

Interesting, I wasn't aware of that and thought the compiler would at least throw up a warning if it had seen that function prototype.


Replies

moefhyesterday at 11:46 PM

It's not intuitive, although arguably conforms to the general C philosophy of not getting in the way unless the code has no chance of being right.

For example, both compilers do complain if you try to pass a literal NULL to `f1` (because that can't possibly be right), the same way they warn about division by a literal zero but give no warnings about dividing by a number that is not known to be nonzero.

show 1 reply