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

Fightwarn - macos llvm - nonliteral format strings #885

Merged

Conversation

jimklimov
Copy link
Member

@jimklimov jimklimov commented Nov 18, 2020

Follows up from #823 and #844 to address warnings from clang10 on MacOS builds: NUT extensively uses string variables from tables or calculated at runtime to pass into various likes of snprintf() and NUT's own routines with fmt+varargs syntax.

This PR highlights such cases of intentional use of non-literal format strings with pragmas to quiesce GCC and CLANG warnings for this.

The main possible point of PR review is to double-check if these cases (now wrapped in pragmas, sometimes spanning large blocks of code with many snprintfs inside) are all intentional and unavoidable. Otherwise, there is little change from previous state of codebase (one avoidable case avoided), so this PR is not likely to break anything :)

@jimklimov jimklimov added the ready / code review Author (and CI) consider the PR worthy of human rewievers' time label Nov 18, 2020
@lgtm-com
Copy link

lgtm-com bot commented Nov 18, 2020

This pull request introduces 1 alert when merging 1396c273c5aadebd4e232b2fc67e92c930215964 into 27e1507 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@jimklimov
Copy link
Member Author

Error reports from clang were cut short by their reporting limits, some more "appeared" in view after the cleanup. PR would grow :)

…os for cleaner fencing (nonliteral format strings)
…acros for cleaner fencing (nonliteral format strings)
…ros for cleaner fencing (nonliteral format strings)
…ros for cleaner fencing (nonliteral format strings)
…lem, and do not warn about nonliteral format string in this case
…rt macros for cleaner fencing (nonliteral format strings)
…macros for cleaner fencing (nonliteral format strings)
… macros for cleaner fencing (nonliteral format strings)
…ros for cleaner fencing (nonliteral format strings)
…t macros for cleaner fencing (nonliteral format strings)
…support macros for cleaner fencing (nonliteral format strings)
…gured-support macros for cleaner fencing (nonliteral format strings)
@jimklimov jimklimov force-pushed the fightwarn-macos-llvm-nonliteral branch from 1396c27 to 659b288 Compare November 24, 2020 21:44
@lgtm-com
Copy link

lgtm-com bot commented Nov 24, 2020

This pull request introduces 1 alert when merging 659b288 into 58fff85 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

@jimklimov
Copy link
Member Author

Several more cases to go, but will go in another PR later, to have gains now and to keep changesets small.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready / code review Author (and CI) consider the PR worthy of human rewievers' time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant