This is not exactly true. Any reasonable compiler will give you an error (not warning)
-
-
-
Is gcc not a reasonable compiler?
- 1 more reply
New conversation -
-
-
C99 says (6.7.5.3p10): "The special case of an unnamed parameter of type void as the only item in the list specifies that the function has no parameters"
-
(so there definitely *is* such a thing as a no-arg function. But you do have to explicitly put "void" rather than an empty parameter list).
- 3 more replies
New conversation -
-
-
clang now has a warning for function declarations without the void: `-Wstrict-prototypes`
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yes, (void) is how C expresses “no arguments”, because () has… history. It's one of the footguns that C++ deliberately did not keep.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.