From e435312f0692996232fc12786be59513a2536489 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 5 Feb 2019 12:48:46 +0100 Subject: aptmethod.h: Do not have gcc warning about ignoring write() result This is a special case here, a best effort write, so there's no point in having warnings about it for every method. --- methods/aptmethod.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/methods/aptmethod.h b/methods/aptmethod.h index f6613ac3b..02ef04cf9 100644 --- a/methods/aptmethod.h +++ b/methods/aptmethod.h @@ -339,11 +339,18 @@ protected: constexpr const char *str1 = "\n **** Seccomp prevented execution of syscall "; constexpr const char *str2 = " on architecture "; constexpr const char *str3 = " ****\n"; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" +#endif write(2, str1, strlen(str1)); write(2, buffer, sizeof(buffer)); write(2, str2, strlen(str2)); write(2, COMMON_ARCH, strlen(COMMON_ARCH)); write(2, str3, strlen(str3)); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif _exit(31); }; action.sa_flags = SA_SIGINFO; -- cgit v1.2.3