bug-gnulib
[Top][All Lists]
Advanced

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

Re: Debian Stretch: strndup.c build failure


From: Bruno Haible
Subject: Re: Debian Stretch: strndup.c build failure
Date: Tue, 07 Jan 2020 19:00:53 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; )

Hi Tim,

> with the latest gnulib (a7903da07d3d18c23314aa0815adbb4058fd7cec) on
> Debian Stretch:
> 
> In file included from /usr/include/string.h:630:0,
>                  from ./string.h:41,
>                  from strndup.c:21:
> strndup.c:26:1: error: expected identifier or '(' before '__extension__'
>  strndup (char const *s, size_t n)
>  ^
> 
> config.log is at
> https://gitlab.com/gnuwget/wget2/-/jobs/395706872/artifacts/file/config.log.

An invocation of AC_CHECK_FUNC is malfunctioning because of -Werror:


configure:8814: checking for strndup
configure:8814: ccache gcc -o conftest -O1 -g -ggdb3 -Werror   conftest.c  >&5
conftest.c:150:6: error: conflicting types for built-in function 'strndup' 
[-Werror]
 char strndup ();
      ^~~~~~~
cc1: all warnings being treated as errors
configure:8814: $? = 1
configure: failed program was:
| /* confdefs.h */
| ...
| /* end confdefs.h.  */
| /* Define strndup to an innocuous variant, in case <limits.h> declares 
strndup.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define strndup innocuous_strndup
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char strndup (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef strndup
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char strndup ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_strndup || defined __stub___strndup
| choke me
| #endif
| 
| int
| main ()
| {
| return strndup ();
|   ;
|   return 0;
| }
configure:8814: result: no


For this reason, -Werror is not supported at configuration-time in gnulib [1].

Bruno

[1] https://lists.gnu.org/archive/html/bug-gnulib/2019-07/msg00081.html




reply via email to

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