From nobody Mon May 6 20:58:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1564495853; cv=none; d=zoho.com; s=zohoarc; b=dGQfnvsjp1A5lp9zS0oF+ZiIW5lTIOMrqgrjoSW/QaR7clEQWk/LOjgyhWIl5pUfi/TWaLdzW+YIm1x3mDDZQydbxhGYDXyXewe5arMJvY2iuRmjWsRnI9rmzNxXf5hfIvP2YMt8Ov4SMQm6220V90mgUAH5vzjG1gvr2lKxs34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564495853; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=rHgsd+eUbG4ff4OfB8MBIp6jwHnZkT2gRZdbYyVGhG8=; b=YW0MO3NP5fzYXIDFKc5BgN/HuHSlD6QgKM8ZWsbzRXcFU+xQTlmXq+qxBsMPbD9cQLNOJgvJZB1XGw/5AUvJbqRZiWyfFr7iexpZ46LRm4AnBEqSC+4Dst/4+g21Tz3GIuUmQ7/ql2bGYoZVQE8BXUoPZ81MkmGlszi+JvlyR9g= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564495853657560.9214114834369; Tue, 30 Jul 2019 07:10:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEA423082AF2; Tue, 30 Jul 2019 14:10:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86BA010016E8; Tue, 30 Jul 2019 14:10:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A91441806B01; Tue, 30 Jul 2019 14:10:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6UEAmUJ015681 for ; Tue, 30 Jul 2019 10:10:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7507E5D971; Tue, 30 Jul 2019 14:10:48 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id D82CA5D978; Tue, 30 Jul 2019 14:10:45 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Tue, 30 Jul 2019 15:10:36 +0100 Message-Id: <20190730141036.26679-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] build: bump min required gcc to 4.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 30 Jul 2019 14:10:52 +0000 (UTC) The previous bump to 4.4 was done in: commit 24241c236e5e0b0b51a33ba539b40f5429a0df0e Author: Daniel P. Berrange Date: Wed Jul 5 10:35:32 2017 +0100 Require use of GCC 4.4 or CLang compilers with 4.4 picked due to RHEL-6. Since we dropped RHEL-6, the next oldest distros are RHEL-7 (4.8.5) or Debian Jessie (4.9.2). Thus we pick 4.8 as the new min. Signed-off-by: Daniel P. Berrang=C3=A9 --- config-post.h | 6 ++-- m4/virt-compile-warnings.m4 | 71 ++----------------------------------- src/internal.h | 44 +++++++---------------- src/util/virbuffer.c | 3 -- src/util/virstring.c | 3 -- src/util/virsysinfo.c | 4 --- 6 files changed, 19 insertions(+), 112 deletions(-) diff --git a/config-post.h b/config-post.h index 093f84a7ce..f928e19273 100644 --- a/config-post.h +++ b/config-post.h @@ -71,7 +71,7 @@ #endif /* LIBVIRT_NSS */ =20 #ifndef __GNUC__ -# error "Libvirt requires GCC >=3D 4.4, or CLang" +# error "Libvirt requires GCC >=3D 4.8, or CLang" #endif =20 /* @@ -86,6 +86,6 @@ ((__GNUC__ << 16) + __GNUC_MINOR__ >=3D ((maj) << 16) + (min)) #endif =20 -#if !(__GNUC_PREREQ(4, 4) || defined(__clang__)) -# error "Libvirt requires GCC >=3D 4.4, or CLang" +#if !(__GNUC_PREREQ(4, 8) || defined(__clang__)) +# error "Libvirt requires GCC >=3D 4.8, or CLang" #endif diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index fc185aef38..f9460e82ba 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -68,61 +68,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html dontwarn=3D"$dontwarn -Wdisabled-optimization" =20 - # gcc 4.2 treats attribute(format) as an implicit attribute(nonnull), - # which triggers spurious warnings for our usage - AC_CACHE_CHECK([whether the C compiler's -Wformat allows NULL strings], - [lv_cv_gcc_wformat_null_works], [ - save_CFLAGS=3D$CFLAGS - CFLAGS=3D'-Wunknown-pragmas -Werror -Wformat' - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - static __attribute__ ((__format__ (__printf__, 1, 2))) int - foo (const char *fmt, ...) { return !fmt; } - ]], [[ - return foo(NULL); - ]])], - [lv_cv_gcc_wformat_null_works=3Dyes], - [lv_cv_gcc_wformat_null_works=3Dno]) - CFLAGS=3D$save_CFLAGS]) - - # Gnulib uses '#pragma GCC diagnostic push' to silence some - # warnings, but older gcc doesn't support this. - AC_CACHE_CHECK([whether pragma GCC diagnostic push works], - [lv_cv_gcc_pragma_push_works], [ - save_CFLAGS=3D$CFLAGS - CFLAGS=3D'-Wunknown-pragmas -Werror' - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #pragma GCC diagnostic push - #pragma GCC diagnostic pop - ]])], - [lv_cv_gcc_pragma_push_works=3Dyes], - [lv_cv_gcc_pragma_push_works=3Dno]) - CFLAGS=3D$save_CFLAGS]) - if test $lv_cv_gcc_pragma_push_works =3D no; then - dontwarn=3D"$dontwarn -Wmissing-prototypes" - dontwarn=3D"$dontwarn -Wmissing-declarations" - dontwarn=3D"$dontwarn -Wcast-align" - else - AC_DEFINE_UNQUOTED([WORKING_PRAGMA_PUSH], 1, - [Define to 1 if gcc supports pragma push/pop]) - fi - - dnl Check whether strchr(s, char variable) causes a bogus compile - dnl warning, which is the case with GCC < 4.6 on some glibc - AC_CACHE_CHECK([whether the C compiler's -Wlogical-op gives bogus warn= ings], - [lv_cv_gcc_wlogical_op_broken], [ - save_CFLAGS=3D"$CFLAGS" - CFLAGS=3D"-O2 -Wlogical-op -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - ]], [[ - const char *haystack; - char needle; - return strchr(haystack, needle) =3D=3D haystack;]])], - [lv_cv_gcc_wlogical_op_broken=3Dno], - [lv_cv_gcc_wlogical_op_broken=3Dyes]) - CFLAGS=3D"$save_CFLAGS"]) - + # Broken in 6.0 and later + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69602 AC_CACHE_CHECK([whether gcc gives bogus warnings for -Wlogical-op], [lv_cv_gcc_wlogical_op_equal_expr_broken], [ save_CFLAGS=3D"$CFLAGS" @@ -188,14 +135,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ wantwarn=3D"$wantwarn -Wswitch-enum" =20 # GNULIB turns on -Wformat=3D2 which implies -Wformat-nonliteral, - # so we need to manually re-exclude it. Also, older gcc 4.2 - # added an implied ATTRIBUTE_NONNULL on any parameter marked - # ATTRIBUTE_FMT_PRINT, which causes -Wformat failure on our - # intentional use of virReportError(code, NULL). + # so we need to manually re-exclude it. wantwarn=3D"$wantwarn -Wno-format-nonliteral" - if test $lv_cv_gcc_wformat_null_works =3D no; then - wantwarn=3D"$wantwarn -Wno-format" - fi =20 # -Wformat enables this by default, and we should keep it, # but need to rewrite various areas of code first @@ -283,12 +224,6 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ #endif ]) =20 - if test "$gl_cv_warn_c__Wlogical_op" =3D yes && - test "$lv_cv_gcc_wlogical_op_broken" =3D yes; then - AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP_STRCHR], 1, - [Define to 1 if gcc -Wlogical-op reports false positives on strchr]) - fi - if test "$gl_cv_warn_c__Wlogical_op" =3D yes && test "$lv_cv_gcc_wlogical_op_equal_expr_broken" =3D yes; then AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP_EQUAL_EXPR], 1, diff --git a/src/internal.h b/src/internal.h index f718895460..adc1e3f496 100644 --- a/src/internal.h +++ b/src/internal.h @@ -185,54 +185,36 @@ # endif #endif =20 -#if WORKING_PRAGMA_PUSH -# define VIR_WARNINGS_NO_CAST_ALIGN \ +#define VIR_WARNINGS_NO_CAST_ALIGN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wcast-align\"") =20 -# define VIR_WARNINGS_NO_DEPRECATED \ +#define VIR_WARNINGS_NO_DEPRECATED \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") =20 -# if HAVE_SUGGEST_ATTRIBUTE_FORMAT -# define VIR_WARNINGS_NO_PRINTF \ +#if HAVE_SUGGEST_ATTRIBUTE_FORMAT +# define VIR_WARNINGS_NO_PRINTF \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=3Dformat\"") -# else -# define VIR_WARNINGS_NO_PRINTF \ +#else +# define VIR_WARNINGS_NO_PRINTF \ _Pragma ("GCC diagnostic push") -# endif +#endif =20 /* Workaround bogus GCC 6.0 for logical 'or' equal expression warnings. * (GCC bz 69602) */ -# if BROKEN_GCC_WLOGICALOP_EQUAL_EXPR -# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ +#if BROKEN_GCC_WLOGICALOP_EQUAL_EXPR +# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wlogical-op\"") -# else -# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ - _Pragma ("GCC diagnostic push") -# endif - -# define VIR_WARNINGS_RESET \ - _Pragma ("GCC diagnostic pop") #else -# define VIR_WARNINGS_NO_CAST_ALIGN -# define VIR_WARNINGS_NO_DEPRECATED -# define VIR_WARNINGS_NO_PRINTF -# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR -# define VIR_WARNINGS_RESET -#endif - -/* Workaround bogus GCC < 4.6 that produces false -Wlogical-op warnings for - * strchr(). Those old GCCs don't support push/pop. */ -#if BROKEN_GCC_WLOGICALOP_STRCHR -# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR \ - _Pragma ("GCC diagnostic ignored \"-Wlogical-op\"") -#else -# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR +# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ + _Pragma ("GCC diagnostic push") #endif =20 +#define VIR_WARNINGS_RESET \ + _Pragma ("GCC diagnostic pop") =20 /* * Use this when passing possibly-NULL strings to printf-a-likes. diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index ac03b15a61..12b33f8bd6 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -421,9 +421,6 @@ virBufferVasprintf(virBufferPtr buf, const char *format= , va_list argptr) } =20 =20 -VIR_WARNINGS_NO_WLOGICALOP_STRCHR - - /** * virBufferEscapeString: * @buf: the buffer to append to diff --git a/src/util/virstring.c b/src/util/virstring.c index 95bd7d225e..bd269e98fe 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -1350,9 +1350,6 @@ virStringHasControlChars(const char *str) } =20 =20 -VIR_WARNINGS_NO_WLOGICALOP_STRCHR - - /** * virStringStripControlChars: * @str: the string to strip diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 5be5e5133d..af26e0bab9 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -478,10 +478,6 @@ virSysinfoReadARM(void) return NULL; } =20 - - -VIR_WARNINGS_NO_WLOGICALOP_STRCHR - static char * virSysinfoParseS390Delimited(const char *base, const char *name, char **va= lue, char delim1, char delim2) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list