klibc-bot for Ben Hutchings
2020-Mar-28 22:36 UTC
[klibc] [klibc:master] Suppress format truncation warnings for sprintf() and vsprintf()
Commit-ID: d8e32d95a1bff2639f9ede9eae9b07b53f37bdac Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=d8e32d95a1bff2639f9ede9eae9b07b53f37bdac Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 28 Mar 2020 21:57:26 +0000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:57:26 +0000 [klibc] Suppress format truncation warnings for sprintf() and vsprintf() These functions pass a huge maximum size to the corresponding length-limiting functions. gcc warns about this and suggests that we should pass INT_MAX at most. I don't think this is correct, so suppress the warnings. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/klibc/Kbuild | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild index 19ccfbec..24bad07d 100644 --- a/usr/klibc/Kbuild +++ b/usr/klibc/Kbuild @@ -83,6 +83,11 @@ ifeq ($(CONFIG_KLIBC_ERRLIST),y) KLIBCCFLAGS_strerror.o += -DWITH_ERRLIST endif +# These pass a huge maximum length to the corresponding length-limiting +# functions +KLIBCCFLAGS_sprintf.o += -Wno-format-truncation +KLIBCCFLAGS_vsprintf.o += -Wno-format-truncation + # sigsuspend.c includes <klibc/havesyscall.h> generated by syscalls/ # build, so require that to build first $(obj)/sigsuspend.o: $(obj)/syscalls/klib.list
Seemingly Similar Threads
- [klibc:master] Fix missing header dependency for sigsuspend.o
- [kvm-unit-tests PATCH v3 1/4] Kbuild: add support for clang builds
- [klibc:master] Kbuild: add support for clang builds
- Klibc 2.0.2 build vs -j 30-ish
- [PATCH/RFC] klibc/kbuild: use separate kbuild files for each klibc subdirectory