-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
snprintf warning with ubuntu + c89 + clang + cmake #927
Comments
The Ubuntu clang complaint makes sense, since C89/C90 doesn't have |
Then the clang C89/90 behaviour with configure is (at least) inconsistent as it builds without warning. As does gcc with C89. Admittedly, this is an edge condition -- goodness knows if anyone has a valid use case that needs C89 these days. I'm sure the cmake code can be made to do make everything consistent if needed. I just don't know it well enough to hack it. Either that or set a minimum C spec that the code needs to conform to. |
Until very recently (VS 2022), Microsoft Visual C only supported C89/90. However it does have, and has had, I am thinking of checking |
configure checks directly for those functions, and doesn't use them if they're not there. |
Crikey! C89 is not an edge condition at all then.
I think that should be enough to catch the clang use-case I highlighted. Hopefully no need to add cmake code to mirror the check-by-compilation test that configure does for |
I have pushed some commits on the develop branch. Let me know how that works for you. |
Thanks, that silences the warnings |
This is taken from #926 (comment)
Seeing the warnings below with c89 (and iso9899:199409) + clang + cmake on Ubuntu. The equivalent Mac build is fine. Also there is no issue when built with configure, so the issue must lie with
zconf.h
and/or the clang commandline.Adding
-DNO_vsnprintf
toCFLAGS
sorts this issue. Fix needed is to getCMakesList.txt
to do the equivalent test thatconfigure
does forvsnprintf
.The cmake function check_c_source_compiles looks like a candidate for this change.
The text was updated successfully, but these errors were encountered: