Add 'void' to clear strict-prototype warnings#789
Conversation
90a8457 to
3ea943b
Compare
|
To understand: what's wrong with the empty |
|
It's a deprecated declaration syntax (for as long as I can remember, actually). Unspecified parameters tells the compiler not to check for parameter mismatches. Providing the explicit list of parameters ensures that the compiler can verify that callers are providing the correct number and type of parameters. For functions with zero parameters, the "explicit list" means specifying "void". C++ fixed this by making "()" equal to "(void)", but C has not adopted this due to incompatibility with existing code styles. |
|
Ok, thanks - given that I don't think this has ever caused an issue for us, there is an argument that we just silence the warning. However I'm fine with fixing them too, but if we do I think we should make it an error with |
Totally fine either way. It was the squeakiest of them on my machine and turned out to be easily corrected. If you'd rather silence them, I can open a separate PR with that change.
Agreed. I've updated the PR to add strict-prototypes to the errors list, and sorted the |
|
I'm in favor of adding |
When building on my machine, a LOT of "strict-prototype" warnings are generated (hundreds). This PR fixes them, and should have no in-game effects.
My compiler:
This is a largely automatic refactor, the majority of these changes can be found using a find/replace regex:
find:
^(.*)\(\) \{replace:
$1(void) {The last few are in
platform.hadded manually.