C11 N1570 standard draft
void f() is deprecated, void f(void) recommended:
6.11.6 Function declarators:
1
The use of function declarators with empty parentheses (not prototype-format parameter
type declarators) is an obsolescent feature.
Introduction:
2 Certain features are obsolescent, which means that they may be considered for
withdrawal in future revisions of this International Standard. They are retained because
of their widespread use, but their use in new implementations (for implementation
features) or new programs (for language [6.11] or library features [7.31]) is discouraged.
Detailed discussion: https://stackoverflow.com/a/36292431/895245
C++11 N3337 standard draft
Neither void f(void) nor void f() are deprecated.
void f(void) exists for compatibility with C. Annex C "Compatibility" C.1.7 Clause 8: declarators:
8.3.5 Change: In C ++ , a function declared with an empty parameter list takes no arguments. In C, an empty
parameter list means that the number and type of the function arguments are unknown.
Since void f() is deprecated in C and void f(void) recommended, void f(void) will exist for as long as C++ wants to maintain compatibility.
void f(void) and void f() are the same in C++. So the longer void f(void) only makes sense if you care about writing code that compiles under both C and C++, which is likely not worth it.
Detailed discussion: https://stackoverflow.com/a/36835303/895245