Re: [PATCH] Makefile: enable DEVELOPER by default
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 5, 2018, 03:17 UTC
- Message-ID
- <20180805031709.GF258270@aiede.svl.corp.google.com>
- In-Reply-To
- <CAPig+cRA87UZsynme-by+s2ZmQW2Aus9KQscCU9mXmALCBKkKQ@mail.gmail.com>
Eric Sunshine wrote:
Show 7 quoted lines
> And, compilation warnings are not limited to old compilers. Even my > fully up-to-date FreeBSD 11.2 installation is not warning-free[1]. > > [1]: For instance: > utf8.c:486:28: warning: passing 'iconv_ibp *' (aka 'const char **') to parameter > of type 'char **' discards qualifiers in nested pointer types > [-Wincompatible-pointer-types-discards-qualifiers]
Oh, good catch! POSIX documents iconv has having signature
size_t iconv(iconv_t cd, char **restrict inbuf, size_t *restrict inbytesleft, char **restrict outbuf, size_t *restrict outbytesleft);
The Makefile explains
# Define OLD_ICONV if your library has an old iconv(), where the second # (input buffer pointer) parameter is declared with type (const char **).
which is implemented as
#if defined(OLD_ICONV) || (defined(__sun__) && !defined(_XPG6)) typedef const char * iconv_ibp; #else typedef char * iconv_ibp; #endif
config.mak.uname contains
ifeq ($(uname_S),FreeBSD) NEEDS_LIBICONV = YesPlease OLD_ICONV = YesPlease
So it looks like FreeBSD has modernized and we need to make that conditional in config.mak.uname on $(uname_R). Do you know which version of FreeBSD changed the signature? Care to write a patch?
Thanks, Jonathan