From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: "Tim Rühsen" <tim.ruehsen@gmx.de>
Subject: Re: Debian Stretch: strndup.c build failure
Date: Tue, 07 Jan 2020 19:00:53 +0100 [thread overview]
Message-ID: <16795352.Q8omOGnAUH@omega> (raw)
In-Reply-To: <fa493a82-9581-18ca-1083-108ca7772cd2@gmx.de>
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
next prev parent reply other threads:[~2020-01-07 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-07 14:24 Debian Stretch: strndup.c build failure Tim Rühsen
2020-01-07 15:41 ` Tim Rühsen
2020-01-07 18:00 ` Bruno Haible [this message]
2020-01-07 19:32 ` Tim Rühsen
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=16795352.Q8omOGnAUH@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=tim.ruehsen@gmx.de \
/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).