These patches caused a build failure in GNU libunistring: gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I../../../sources/libunistring/tests -I../lib -I.. -DIN_LIBUNISTRING_GNULIB_TESTS=1 -I. -I../../../sources/libunistring/tests -I.. -I../../../sources/libunistring/tests/.. -I../lib -I../../../sources/libunistring/tests/../lib -Wall -g -O2 -MT locale.o -MD -MP -MF $depbase.Tpo -c -o locale.o ../../../sources/libunistring/tests/locale.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from ../../../sources/libunistring/tests/locale.c:22:0: ./stdio.h:830:5: error: #if with no expression ./stdio.h:846:5: error: #if with no expression ...
The problem is that the macro gl_STDIO_H_REQUIRE_DEFAULTS must only be invoked, never AC_REQUIREd. Hence all gl_STDIO_MODULE_INDICATOR invocations must also only be invoked, never AC_REQUIREd. But gl_STDIO_H is automatically AC_REQUIREd, since it is defined through AC_DEFUN_ONCE. This patch fixes it. 2021-04-17 Bruno Haible <[email protected]> stdio: Fix build error in some configurations (regression 2021-04-11). * m4/stdio_h.m4 (gl_STDIO_H): Move gl_STDIO_MODULE_INDICATOR and gl_MODULE_INDICATOR invocations from here... * modules/stdio (configure.ac): ... to here. diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 6846ca6..d9820e4 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 54 +# stdio_h.m4 serial 55 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -40,17 +40,6 @@ AC_DEFUN_ONCE([gl_STDIO_H], attribute "__gnu_printf__" instead of "__printf__"]) fi - dnl No need to create extra modules for these functions. Everyone who uses - dnl <stdio.h> likely needs them. - gl_STDIO_MODULE_INDICATOR([fscanf]) - gl_MODULE_INDICATOR([fscanf]) - gl_STDIO_MODULE_INDICATOR([scanf]) - gl_MODULE_INDICATOR([scanf]) - gl_STDIO_MODULE_INDICATOR([fgetc]) - gl_STDIO_MODULE_INDICATOR([getc]) - gl_STDIO_MODULE_INDICATOR([getchar]) - gl_STDIO_MODULE_INDICATOR([fgets]) - gl_STDIO_MODULE_INDICATOR([fread]) dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" dnl "expected source file, required through AC_LIBSOURCES, not found". It is dnl also an optimization, to avoid performing a configure check whose result @@ -64,18 +53,6 @@ AC_DEFUN_ONCE([gl_STDIO_H], fi ]) - dnl No need to create extra modules for these functions. Everyone who uses - dnl <stdio.h> likely needs them. - gl_STDIO_MODULE_INDICATOR([fprintf]) - gl_STDIO_MODULE_INDICATOR([printf]) - gl_STDIO_MODULE_INDICATOR([vfprintf]) - gl_STDIO_MODULE_INDICATOR([vprintf]) - gl_STDIO_MODULE_INDICATOR([fputc]) - gl_STDIO_MODULE_INDICATOR([putc]) - gl_STDIO_MODULE_INDICATOR([putchar]) - gl_STDIO_MODULE_INDICATOR([fputs]) - gl_STDIO_MODULE_INDICATOR([puts]) - gl_STDIO_MODULE_INDICATOR([fwrite]) dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" dnl "expected source file, required through AC_LIBSOURCES, not found". It is dnl also an optimization, to avoid performing a configure check whose result diff --git a/modules/stdio b/modules/stdio index 18c24d7..e13b689 100644 --- a/modules/stdio +++ b/modules/stdio @@ -19,6 +19,31 @@ configure.ac: gl_STDIO_H gl_STDIO_H_REQUIRE_DEFAULTS +dnl No need to create extra modules for these functions. Everyone who uses +dnl <stdio.h> likely needs them. +gl_STDIO_MODULE_INDICATOR([fscanf]) +gl_MODULE_INDICATOR([fscanf]) +gl_STDIO_MODULE_INDICATOR([scanf]) +gl_MODULE_INDICATOR([scanf]) +gl_STDIO_MODULE_INDICATOR([fgetc]) +gl_STDIO_MODULE_INDICATOR([getc]) +gl_STDIO_MODULE_INDICATOR([getchar]) +gl_STDIO_MODULE_INDICATOR([fgets]) +gl_STDIO_MODULE_INDICATOR([fread]) + +dnl No need to create extra modules for these functions. Everyone who uses +dnl <stdio.h> likely needs them. +gl_STDIO_MODULE_INDICATOR([fprintf]) +gl_STDIO_MODULE_INDICATOR([printf]) +gl_STDIO_MODULE_INDICATOR([vfprintf]) +gl_STDIO_MODULE_INDICATOR([vprintf]) +gl_STDIO_MODULE_INDICATOR([fputc]) +gl_STDIO_MODULE_INDICATOR([putc]) +gl_STDIO_MODULE_INDICATOR([putchar]) +gl_STDIO_MODULE_INDICATOR([fputs]) +gl_STDIO_MODULE_INDICATOR([puts]) +gl_STDIO_MODULE_INDICATOR([fwrite]) + Makefile.am: BUILT_SOURCES += stdio.h
