bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

terminfo, termcap: Avoid wrong configure result with clang ≥ 15


From: Bruno Haible
Subject: terminfo, termcap: Avoid wrong configure result with clang ≥ 15
Date: Sun, 12 Feb 2023 00:39:39 +0100

Sam James reported that some configure tests always fail with clang ≥ 15,
due to a 'char *' to 'int' conversion that makes the compilation fail.

This patch should fix it.


2023-02-11  Bruno Haible  <bruno@clisp.org>

        terminfo, termcap: Avoid wrong configure result with clang ≥ 15.
        clang 15 reports an error for -Wint-conversion by default.
        Reported by Sam James <sam@gentoo.org> in
        <https://savannah.gnu.org/bugs/?63793>.
        * m4/terminfo.m4 (gl_TERMINFO_BODY): Avoid a -Wint-conversion warning
        when testing for tparam and tparm.
        * m4/termcap.m4 (gl_TERMCAP_BODY): Likewise.

diff --git a/m4/termcap.m4 b/m4/termcap.m4
index ad6cca2a81..fe8b0f0fec 100644
--- a/m4/termcap.m4
+++ b/m4/termcap.m4
@@ -1,4 +1,4 @@
-# termcap.m4 serial 10
+# termcap.m4 serial 11
 dnl Copyright (C) 2000-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -250,7 +250,7 @@ AC_DEFUN([gl_TERMCAP_BODY],
            char * tparam (const char *, void *, int, ...);
            char buf;
          ]],
-         [[return tparam ("\033\133%dm", &buf, 1, 8);]])],
+         [[return ! tparam ("\033\133%dm", &buf, 1, 8);]])],
       [gl_cv_termcap_tparam=yes], [gl_cv_termcap_tparam=no])
     CPPFLAGS="$gl_save_CPPFLAGS"
     LIBS="$gl_save_LIBS"
@@ -274,7 +274,7 @@ AC_DEFUN([gl_TERMCAP_BODY],
              #endif
              char * tparm (const char *, ...);
            ]],
-           [[return tparm ("\033\133%dm", 8);]])],
+           [[return ! tparm ("\033\133%dm", 8);]])],
         [gl_cv_termcap_tparm=yes], [gl_cv_termcap_tparm=no])
       CPPFLAGS="$gl_save_CPPFLAGS"
       LIBS="$gl_save_LIBS"
diff --git a/m4/terminfo.m4 b/m4/terminfo.m4
index 8f729f2e3c..313afa96ab 100644
--- a/m4/terminfo.m4
+++ b/m4/terminfo.m4
@@ -1,4 +1,4 @@
-# terminfo.m4 serial 5
+# terminfo.m4 serial 6
 dnl Copyright (C) 2000-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -372,7 +372,7 @@ AC_DEFUN([gl_TERMINFO_BODY],
            char * tparam (const char *, void *, int, ...);
            char buf;
          ]],
-         [[return tparam ("\033\133%dm", &buf, 1, 8);]])],
+         [[return ! tparam ("\033\133%dm", &buf, 1, 8);]])],
       [gl_cv_terminfo_tparam=yes],
       [gl_cv_terminfo_tparam=no])
     CPPFLAGS="$gl_save_CPPFLAGS"
@@ -397,7 +397,7 @@ AC_DEFUN([gl_TERMINFO_BODY],
              #endif
              char * tparm (const char *, ...);
            ]],
-           [[return tparm ("\033\133%dm", 8);]])],
+           [[return ! tparm ("\033\133%dm", 8);]])],
         [gl_cv_terminfo_tparm=yes], [gl_cv_terminfo_tparm=no])
       CPPFLAGS="$gl_save_CPPFLAGS"
       LIBS="$gl_save_LIBS"






reply via email to

[Prev in Thread] Current Thread [Next in Thread]