Blob Blame History Raw
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 24 Nov 2022 13:10:29 +0100
Subject: [PATCH] Fixes for C99 compatibility

Incompatible pointer types are actually errors (in the sense
that they are invalid C).  Compilers have merely tolerated them as
warnings for backwards compatibility.  This is changing with Clang 16
and GCC 14, so relax the check a little.

Submitted upstream: <https://github.com/fvwmorg/fvwm/pull/100>

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>

diff --git a/configure.ac b/configure.ac
index cd73b925..974c2c0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -220,9 +220,8 @@ AC_MINIX
 
 # catch -Werror and similar options when running configure
 AC_TRY_COMPILE([#include <stdio.h>],
-[int i; int *p; char *c;
-  switch (*p = p = *c) { case 0: printf("%Q", c, p); }
-  *c = &i; c = p;
+[int unused; int *p; char *c;
+  printf("%Q", c, p);
   while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
 ], , AC_MSG_ERROR("
 configure is not able to compile programs with warnings.  Please