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

WIP: COMP: fixed some clang -Wformat-nonliteral warnings #5065

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Dec 14, 2024

Not sure if this works with gcc...

Added an ITK_FORMAT_PRINTF macro to wrap the gcc/clang `__attribute__((format(printf)))`.

Use it to decorate some functions that call vsnprintf().
@github-actions github-actions bot added area:Core Issues affecting the Core module area:IO Issues affecting the IO module labels Dec 14, 2024
@hjmjohnson
Copy link
Member

@seanm This seems to work on all platforms!

@seanm
Copy link
Contributor Author

seanm commented Dec 15, 2024

@seanm This seems to work on all platforms!

Do you know if the CI here has gcc with -Wformat-literal enabled?

@hjmjohnson
Copy link
Member

@seanm I don't think so

git grep format-literal did not have any responses.

@seanm
Copy link
Contributor Author

seanm commented Dec 15, 2024

Where/how can we add warnings flags to CI?

@dzenanz
Copy link
Member

dzenanz commented Dec 16, 2024

I believe you need to set them here and here.

@seanm
Copy link
Contributor Author

seanm commented Dec 16, 2024

Thanks. But I don't see any -W in either of those. Are no warning flags being set already? Just the compiler's default is used?

@dzenanz
Copy link
Member

dzenanz commented Dec 16, 2024

CMake's defaults, probably, which might be slightly different from compiler's defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module area:IO Issues affecting the IO module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants