bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: Florian Weimer <fweimer@redhat.com>
Subject: make autoconf tests work with -Werror=implicit-function-declaration
Date: Sat, 14 Sep 2019 19:50:12 +0200	[thread overview]
Message-ID: <6887158.PPuMJLRhYT@omega> (raw)

There are indications that future GCC versions may be stricter regarding
invocations of undeclared functions. [1] Configuring with
  CC="gcc -Werror=implicit-function-declaration"
is a way to exercise similar functionality with released GCCs.

So, what I did is
  1. create a testdir of all of gnulib,
  2. configure it once with CC="gcc" and once with
     CC="gcc -Werror=implicit-function-declaration", both with option '-C',
  3. compare the resulting config.cache files.

I got differences in the cache variables
  gl_cv_func_ptsname_sets_errno
  gt_cv_locale_tr_utf8

This patch fixes the issues.

[1] https://lists.gnu.org/archive/html/bug-gettext/2019-09/msg00012.html


2019-09-14  Bruno Haible  <bruno@clisp.org>

	Make autoconf tests work with -Werror=implicit-function-declaration.
	* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Include <wctype.h>, for
	towupper() declaration.
	* m4/ptsname.m4 (gl_FUNC_PTSNAME): Include <stdlib.h>, for ptsname()
	declaration.

diff --git a/m4/locale-tr.m4 b/m4/locale-tr.m4
index aeb2419..4c413f0 100644
--- a/m4/locale-tr.m4
+++ b/m4/locale-tr.m4
@@ -1,4 +1,4 @@
-# locale-tr.m4 serial 11
+# locale-tr.m4 serial 12
 dnl Copyright (C) 2003, 2005-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,6 +21,7 @@ changequote(,)dnl
 #endif
 #include <stdlib.h>
 #include <string.h>
+#include <wctype.h>
 struct tm t;
 char buf[16];
 int main () {
diff --git a/m4/ptsname.m4 b/m4/ptsname.m4
index 5033d90..04bfd3b 100644
--- a/m4/ptsname.m4
+++ b/m4/ptsname.m4
@@ -1,4 +1,4 @@
-# ptsname.m4 serial 7
+# ptsname.m4 serial 8
 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,10 +19,12 @@ AC_DEFUN([gl_FUNC_PTSNAME],
     AC_CACHE_CHECK([whether ptsname sets errno on failure],
       [gl_cv_func_ptsname_sets_errno],
       [AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM([[#include <errno.h>
-      ]], [[
-      return ptsname (-1) || !errno;
-           ]])],
+         [AC_LANG_PROGRAM([[
+              #include <stdlib.h>
+              #include <errno.h>
+            ]], [[
+              return ptsname (-1) || !errno;
+            ]])],
          [gl_cv_func_ptsname_sets_errno=yes],
          [gl_cv_func_ptsname_sets_errno=no],
          [case "$host_os" in



             reply	other threads:[~2019-09-14 17:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-14 17:50 Bruno Haible [this message]
2019-09-15 17:04 ` make autoconf tests work with -Werror=implicit-function-declaration Jim Meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6887158.PPuMJLRhYT@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=fweimer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).