Thursday, October 15, 2015

Empty Parentheses Are Not “No Parameters” in (Objective-)C

Jonathan Mah:

Using () in a function type declaration means unspecified parameters. This is a very old feature of C that has been maintained for backward compatibility. In fact, it was noted as an “obsolescent feature” in C89 — yes, that’s 1989!

[…]

Because this warning is apparently unimplemented, huge amounts of otherwise high quality code has these turds lurking in both public API and implementation.

You’re supposed to use (void).

1 Comment RSS · Twitter


C/Unix is a fantastic example of how to bootstrap a successful mass-market platform, and a fantastic lesson in how not to perpetuate one.

Leave a Comment