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

get -Wformat-truncation and -Wformat-overflow re-enabled #343

Open
nickdesaulniers opened this issue Sep 13, 2023 · 1 comment
Open

get -Wformat-truncation and -Wformat-overflow re-enabled #343

nickdesaulniers opened this issue Sep 13, 2023 · 1 comment

Comments

@nickdesaulniers
Copy link
Member

nickdesaulniers commented Sep 13, 2023

Looks like Linus just turned this off in bd664f6.

I suspect that Linus was hitting https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78512#c7 (i.e. the kernel's use of %p with additional non-standard modifiers) which was eventually disabled in GCC.

We hit this in ClangBuiltLinux#1923 because clang had the same checks under a different flag name -Wfortify-source. This is getting fixed in llvm/llvm-project#65969.

These issues still persist (compile time detection of the use of snprintf that result in unconditional truncation). These should be fixed; they're not compiler specfic though, as noted by @nathanchance here. So filing this TODO here so that we can close ClangBuiltLinux#1923 once llvm/llvm-project#65969 lands.

@nickdesaulniers
Copy link
Member Author

As noted by @kees in https://lore.kernel.org/llvm/202308291147.2CB91AB9@keescook/, some of these usages may need larger refactorings, such as the usage of sysfs_emit.

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

1 participant