bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* make autoconf tests work with -Werror=implicit-function-declaration
@ 2019-09-14 17:50 Bruno Haible
  2019-09-15 17:04 ` Jim Meyering
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Haible @ 2019-09-14 17:50 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Florian Weimer

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: make autoconf tests work with -Werror=implicit-function-declaration
  2019-09-14 17:50 make autoconf tests work with -Werror=implicit-function-declaration Bruno Haible
@ 2019-09-15 17:04 ` Jim Meyering
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Meyering @ 2019-09-15 17:04 UTC (permalink / raw)
  To: Bruno Haible; +Cc: Florian Weimer, bug-gnulib@gnu.org List

On Sat, Sep 14, 2019 at 10:51 AM Bruno Haible <bruno@clisp.org> wrote:
> 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

Thanks for your constant vigilance and all the proactive work on gnulib.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-15 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-14 17:50 make autoconf tests work with -Werror=implicit-function-declaration Bruno Haible
2019-09-15 17:04 ` Jim Meyering

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).