Skip to content
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

Clang complains about function without prototype #301

Open
webisu opened this issue Dec 6, 2024 · 2 comments
Open

Clang complains about function without prototype #301

webisu opened this issue Dec 6, 2024 · 2 comments
Assignees

Comments

@webisu
Copy link
Collaborator

webisu commented Dec 6, 2024

The clang compiler is now giving warnings

warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]

@webisu webisu self-assigned this Dec 6, 2024
@edwardhartnett
Copy link
Contributor

Yes, well the warning says it all, doesn't it.

Write prototypes for your functions in a .h file. I usually have a public .h file, and at least one internal .h file. For example on netcdf-c, we have public-facing netcdf.h, and internal-only nc3internal.h, nc4internal.h.

Can you add one or more internal .h files with the missing prototypes?

@webisu
Copy link
Collaborator Author

webisu commented Dec 10, 2024

Wgrib2 uses pointers to functions, and the arguments to the pointer-functions were never prototype-ed. The new clang is the first compiler to rightly warn about the omission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants