From 140ecb12381ef8b930b13c319282878b10c5dcfe Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 15 May 2015 17:35:01 +0200 Subject: [PATCH] linux: prevent hybrid-mode compiler warnings --- repos/base-linux/lib/import/import-lx_hybrid.mk | 3 +++ repos/os/src/server/lx_fs/file.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/repos/base-linux/lib/import/import-lx_hybrid.mk b/repos/base-linux/lib/import/import-lx_hybrid.mk index 9dfeecccaa..fd8fbc316b 100644 --- a/repos/base-linux/lib/import/import-lx_hybrid.mk +++ b/repos/base-linux/lib/import/import-lx_hybrid.mk @@ -109,3 +109,6 @@ LD_LIBGCC = # use the host c++ for linking to find shared libraries in DT_RPATH library paths LD_CMD = c++ + +# disable format-string security checks, which prevent non-literal format strings +CC_OPT += -Wno-format-security diff --git a/repos/os/src/server/lx_fs/file.h b/repos/os/src/server/lx_fs/file.h index 85d5e4a050..406fa455d3 100644 --- a/repos/os/src/server/lx_fs/file.h +++ b/repos/os/src/server/lx_fs/file.h @@ -129,7 +129,7 @@ class File_system::File : public Node void truncate(file_size_t size) { - ftruncate(_fd, size); + if (ftruncate(_fd, size)) /* nothing */; mark_as_updated(); }