-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A function declaration without a prototype is deprecated in all versions of C #17
Comments
Are you actually sure that we also get compilation errors with the empty parameter lists? Because those I imagine we have a whole bunch of, and honestly the |
Yes, the error messages are quite explicit e.g.:
I even read somewhere that in the backgroung "int foo()" is actually using the K&R-style function definition syntax (with an empty identifier lists), not an empty parameter list, but I can't find the reference now. |
Ok, got it! In that case I will update the functions with no arguments in ncrystaldev / .. / ncrystal.h as well. |
However, I hope that this does not apply to argument-less functions in C++ code inside |
To answer myself: I think argument-less functions in C++ code inside |
I guess we can close this now. |
After upgrading to XCode 14.3 (requires macOS Ventura 13.0 or later), I get a lot of compillation errors (warnings treated as errors) saying "A function declaration without a prototype is deprecated in all versions of C".
This is because "C2x will be removing support for functions with identifier lists, and will be changing the behavior of prototypeless functions with empty parentheses to match the behavior of C++" (from link)
A lot of functions in MiniZLib use the now unsupported identifier lists (a part of K&R-style function definition syntax). The errors/warnings could be silenced by using DG_EXTRA_CFLAGS=-Wno-strict-prototypes compillation flag (as suggested in madler/zlib#633 ), but for us it would be better to change the function definitions:
to
Also, for similar reason, empty parameter lists should be given an explicit parameter of void:
to
The text was updated successfully, but these errors were encountered: