From 4bbc519626a7b42be2fcf384d2b6869b811eb611 Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Tue, 4 Sep 2018 19:48:00 +0200 Subject: [PATCH] dbus: demote clang c99-extensions error to warning This commit uses GCC friendly pragmas to demote a clang error on C99-specific feature usage to a warning. The C99 feature that is used here is compound literals. It gets used trough a macro from the dbus C library. --- src/anbox/dbus/stub/application_manager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/anbox/dbus/stub/application_manager.cpp b/src/anbox/dbus/stub/application_manager.cpp index 3487793..58b716c 100644 --- a/src/anbox/dbus/stub/application_manager.cpp +++ b/src/anbox/dbus/stub/application_manager.cpp @@ -114,7 +114,12 @@ void ApplicationManager::launch(const android::Intent &intent, if (r < 0) throw std::runtime_error("Failed to construct DBus message"); + #pragma GCC diagnostic push + #pragma GCC diagnostic warning "-Wpragmas" + #pragma GCC diagnostic warning "-Wc99-extensions" sd_bus_error error = SD_BUS_ERROR_NULL; + #pragma GCC diagnostic pop + r = sd_bus_call(bus_->raw(), m, 0, &error, nullptr); if (r < 0) { const auto msg = utils::string_format("%s", error.message);