From d34b7e627122ad67c1a312b0079971e5577ffa65 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Wed, 17 Jul 2019 19:32:32 -0300 Subject: [PATCH] cxx: remove a compilation warning for g++ 7.x Remove a compilation warning about an unsupported warning category for g++ 7.x. A `#pragma` directive was used to suppress a `-Wcast-function-type` warning in g++. Versions older than 8.x do not have this warning category and raises a warning because of this directive. Now this directive is only enabled for g++ version 8.x or newer. --- src/bindings/cxx/eldbus_cxx/eldbus_service.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/cxx/eldbus_cxx/eldbus_service.hh b/src/bindings/cxx/eldbus_cxx/eldbus_service.hh index 31c3386..7d1e005 100644 --- a/src/bindings/cxx/eldbus_cxx/eldbus_service.hh +++ b/src/bindings/cxx/eldbus_cxx/eldbus_service.hh @@ -298,7 +298,7 @@ void _create_methods_specification_impl(Method const& method, Eldbus_Method2& el // C++ always raises a warning for such conversions, so this warning // can be disabled just here. #pragma GCC diagnostic push -#ifndef __clang__ +#if !defined(__clang__) && __GNUC__ >= 8 #pragma GCC diagnostic ignored "-Wcast-function-type" #endif Eldbus_Method_Cb method_cb = -- 2.7.4