Under ANSI C (not C++)
int f1();
is very different from
int f1(void);
declaration 1 declares function f1 without any prototypes, so can be called
with any arguments.
Declaration 2 declares function f2 with a prototype having no parameters,
so can only be called with no arguments.
Declaration 2 is still valid C++ code, so that is not a problem.
There are many instances of this within the code, which generates extra
warnings.
int f1();
is very different from
int f1(void);
declaration 1 declares function f1 without any prototypes, so can be called
with any arguments.
Declaration 2 declares function f2 with a prototype having no parameters,
so can only be called with no arguments.
Declaration 2 is still valid C++ code, so that is not a problem.
There are many instances of this within the code, which generates extra
warnings.
- duplicates
-
JDK-4144493 Shared code mods to add "void" to function prototypes with empty argument list
- Closed