[libvirt PATCH 0/3] Bump some min versions

Given previous platforms we've dropped, we can bump the min compilers. Daniel P. Berrangé (3): configure: bump min required GCC to 7.4.0 configure: bump min required CLang to 6.0 / XCode 10.0 examples: drop some conditionals checks from macros config.h | 14 +++++++------- examples/c/misc/event-test.c | 14 ++------------ 2 files changed, 9 insertions(+), 19 deletions(-) -- 2.33.1

Several distros have been dropped since the last time we bumped the minimum required GCC version. Per repology, currently shipping versions are: RHEL-8: 8.3.1 Debian Buster: 8.3.0 openSUSE Leap 15.2: 7.5.0 Ubuntu LTS 18.04: 7.5.0 Ubuntu LTS 20.04: 9.3.0 FreeBSD: 10.3.0 Fedora 33: 9.2.0 Fedora 34: 11.0.1 OpenBSD: 8.4.0 macOS HomeBrew: 11.1.0 With this list Ubuntu LTS 18.04 / openSUSE Leap 15.2 are the constraint at 7.5.0. When QEMU bumped GCC to 7.5.0, however, it was reported that this is a problem for NetBSD which still ships 7.4.0. NetBSD is not an officially targetted platform for libvirt. Given that QEMU saw complaints about this and the feature difference between GCC 7.4.0 and 7.5.0 is minor, I'm being friendly and sticking 7.4.0. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index 0eacfd139d..2ef32c8627 100644 --- a/config.h +++ b/config.h @@ -45,9 +45,9 @@ # endif # endif #elif defined(__GNUC__) && defined(__GNUC_MINOR__) -# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) -# error You need at least GCC v4.8 to compile libvirt +# if __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4) +# error You need at least GCC v7.4.0 to compile libvirt # endif #else -# error You either need at least GCC 4.8 or Clang 3.4 or XCode Clang 5.1 to compile libvirt +# error You either need at least GCC 7.4.0 or Clang 3.4 or XCode Clang 5.1 to compile libvirt #endif -- 2.33.1

Several distros have been dropped since the last time we bumped the minimum required CLang version. Per repology, currently shipping versions are: RHEL-8: 10.0.1 Debian Buster: 7.0.1 openSUSE Leap 15.2: 9.0.1 Ubuntu LTS 18.04: 6.0.0 Ubuntu LTS 20.04: 10.0.0 FreeBSD 12: 8.0.1 Fedora 33: 11.0.0 Fedora 34: 11.1.0 With this list Ubuntu LTS 18.04 is the constraint at 6.0.0 An LLVM version of 6.0.0 corresponds to macOS XCode version of 10.0 which dates from Sept 2018. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- config.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.h b/config.h index 2ef32c8627..cc887db222 100644 --- a/config.h +++ b/config.h @@ -36,12 +36,12 @@ #if defined(__clang_major__) && defined(__clang_minor__) # ifdef __apple_build_version__ -# if __clang_major__ < 5 || (__clang_major__ == 5 && __clang_minor__ < 1) -# error You need at least XCode Clang v5.1 to compile libvirt +# if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0) +# error You need at least XCode Clang v10.0 to compile libvirt # endif # else -# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4) -# error You need at least Clang v3.4 to compile libvirt +# if __clang_major__ < 6 || (__clang_major__ == 6 && __clang_minor__ < 4) +# error You need at least Clang v6.0 to compile libvirt # endif # endif #elif defined(__GNUC__) && defined(__GNUC_MINOR__) @@ -49,5 +49,5 @@ # error You need at least GCC v7.4.0 to compile libvirt # endif #else -# error You either need at least GCC 7.4.0 or Clang 3.4 or XCode Clang 5.1 to compile libvirt +# error You either need at least GCC 7.4.0 or Clang 6.0 or XCode Clang 10.0 to compile libvirt #endif -- 2.33.1

We no longer need to worry about GCC version older than 7.4.0. The other remaining conditionals checks were also overkill for the example code. In the unlikely event that someone tries to re-use the code in a scenario where further conditions apply they can figure out. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- examples/c/misc/event-test.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c index 1eec76c79d..1165469a65 100644 --- a/examples/c/misc/event-test.c +++ b/examples/c/misc/event-test.c @@ -12,18 +12,8 @@ #define G_N_ELEMENTS(Array) (sizeof(Array) / sizeof(*(Array))) #define STREQ(a, b) (strcmp(a, b) == 0) #define NULLSTR(s) ((s) ? (s) : "<null>") - -#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \ - && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \ - && !defined __cplusplus) -# define G_STATIC_ASSERT(cond) _Static_assert(cond, "verify (" #cond ")") -#else -# define G_STATIC_ASSERT(cond) -#endif - -#ifndef G_GNUC_UNUSED -# define G_GNUC_UNUSED __attribute__((__unused__)) -#endif +#define G_STATIC_ASSERT(cond) _Static_assert(cond, "verify (" #cond ")") +#define G_GNUC_UNUSED __attribute__((__unused__)) int run = 1; -- 2.33.1

On a Friday in 2022, Daniel P. Berrangé wrote:
Given previous platforms we've dropped, we can bump the min compilers.
Daniel P. Berrangé (3): configure: bump min required GCC to 7.4.0 configure: bump min required CLang to 6.0 / XCode 10.0 examples: drop some conditionals checks from macros
config.h | 14 +++++++------- examples/c/misc/event-test.c | 14 ++------------ 2 files changed, 9 insertions(+), 19 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Daniel P. Berrangé
-
Ján Tomko