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

Fixed Clang -Wstrict-prototypes warnings #2239

Merged
merged 1 commit into from Mar 9, 2022

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Mar 2, 2022

Clang is considering making this warning an error by default: https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521

@seanm seanm requested a review from WardF as a code owner March 2, 2022 04:22
@CLAassistant
Copy link

CLAassistant commented Mar 2, 2022

CLA assistant check
All committers have signed the CLA.

@DennisHeimbigner
Copy link
Collaborator

There may be a problem here. The files ncgeny.c and others are generated
using bison. It is possible that some of the generated code violates
the strict prototype rule and we cannot fix this; it requires a change in bison.
Same for .l files and flex.

@seanm
Copy link
Contributor Author

seanm commented Mar 2, 2022

I changed the .l and .y files too, to match the changes I made in the .c files. It looks to me like regeneration would be ok, but I did not try.

@WardF WardF self-assigned this Mar 2, 2022
@WardF
Copy link
Member

WardF commented Mar 2, 2022

@seanm thanks! @DennisHeimbigner that's a good point, I think I will add a one-off set of tests to the github actions file that explicitly regenerates those generated files we depend upon, to ensure that any changes to the .y files are also explicitly tested.

For this PR, I will pull the changes into a local branch, regenerate via bison and test by hand :).

Thanks again!

@WardF
Copy link
Member

WardF commented Mar 2, 2022

@seanm Are you able to sign the license agreement (CLA)?

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

@DennisHeimbigner
Copy link
Collaborator

It is probably ok. But bison and flex generate code (including prototypes) not
found in the .l or .y files.

@seanm
Copy link
Contributor Author

seanm commented Mar 9, 2022

@WardF did I sign it correctly? Anything else needed to get this merged?

@WardF WardF merged commit 84b109e into Unidata:main Mar 9, 2022
@WardF
Copy link
Member

WardF commented Mar 9, 2022

You did, thank you!

@seanm
Copy link
Contributor Author

seanm commented Mar 9, 2022

Great, thanks. You might want to consider enabling this warning on your CI, if you have a clang that supports it...

@WardF
Copy link
Member

WardF commented Mar 9, 2022

Not a bad idea, thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants