bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Tim Rühsen" <tim.ruehsen@gmx.de>
To: bug-gnulib@gnu.org
Subject: Re: Debian Stretch: strndup.c build failure
Date: Tue, 7 Jan 2020 16:41:47 +0100	[thread overview]
Message-ID: <a6dd467e-9002-9564-16a2-59720238471b@gmx.de> (raw)
In-Reply-To: <fa493a82-9581-18ca-1083-108ca7772cd2@gmx.de>


[-- Attachment #1.1: Type: text/plain, Size: 1881 bytes --]

On 1/7/20 3:24 PM, Tim Rühsen wrote:
> Hi,
> 
> 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.

The issue is that the ./configure step is run with CFLAGS="-Werror"
(here with CC=clang):

$ grep strndup config.log
configure:8814: checking for strndup
conftest.c:152:6: error: incompatible redeclaration of library function
'strndup' [-Werror,-Wincompatible-library-redeclaration]
char strndup ();
conftest.c:152:6: note: 'strndup' is a builtin with type 'char *(const
char *, unsigned long)'
| /* Define strndup to an innocuous variant, in case <limits.h> declares
strndup.
| #define strndup innocuous_strndup
|     which can conflict with char strndup (); below.
| #undef strndup
| char strndup ();
| #if defined __stub_strndup || defined __stub___strndup
| return strndup ();
configure:20326: checking whether strndup is declared
ac_cv_func_strndup=no
ac_cv_have_decl_strndup=yes


Though it always worked (for my projects), I can imagine that
./configure tests may stumble when -Werror is set. So, is it good
practice not to use -Werror with ./configure ?


Without -Werror:
$ grep strndup config.log
configure:8814: checking for strndup
conftest.c:154:6: warning: conflicting types for built-in function 'strndup'
 char strndup ();
configure:20326: checking whether strndup is declared
configure:38601: checking for working strndup
ac_cv_func_strndup=yes
ac_cv_have_decl_strndup=yes
gl_cv_func_strndup_works=yes


Regards, Tim


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-01-07 15:50 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 [this message]
2020-01-07 18:00 ` Bruno Haible
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=a6dd467e-9002-9564-16a2-59720238471b@gmx.de \
    --to=tim.ruehsen@gmx.de \
    --cc=bug-gnulib@gnu.org \
    /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).