From: Dave Chinner <david@fromorbit.com>
To: "Jan Ťulák" <jtulak@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: xfsprogs compile warnings: _BSD_SOURCE is deprecated in glibc 2.20.
Date: Wed, 29 Apr 2015 07:12:59 +1000 [thread overview]
Message-ID: <20150428211259.GZ21261@dastard> (raw)
In-Reply-To: <1430219344-11662-1-git-send-email-jtulak@redhat.com>
On Tue, Apr 28, 2015 at 01:09:04PM +0200, Jan Ťulák wrote:
> In glibc 2.20, _BSD_SOURCE and _SVID_SOURCE were deprecated and should be
> replaced with _DEFAULT_SOURCE. Currently, compiling xfsprogs on a system with
> glibc in said or newer version (like current Fedora) produces tons of warnings
> like this one:
>
> In file included from /usr/include/stdio.h:27:0,
> from ../include/xfs/platform_defs.h:24,
> from ../include/xfs/libxfs.h:25,
> from xfs_mkfs.c:19:
> /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
> # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
>
> It can be fixed with the single line patch bellow, but I'm not sure if we can
> remove the deprecated version because of compatiblity. Glibc 2.19, which added
> _DEFAULT_SOURCE, was released in 2014, and I'm not sure how much it is
> backported and how much xfsprogs are backported too. So, do we need a better
> patch to take care of this and provide differend _SOURCE based on glibc
> version, or this patch is enough?
>
> Source: man 7 feature_test_macros
> Here is a link in case you older version:
> http://man7.org/linux/man-pages/man7/feature_test_macros.7.html
/me smacks head against wall
Really? glibc has decided to break the build of half the world?
> Signed-off-by: Jan Ťulák <jtulak@redhat.com>
> ---
> include/builddefs.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/builddefs.in b/include/builddefs.in
> index 944bcf6..6e6097a 100644
> --- a/include/builddefs.in
> +++ b/include/builddefs.in
> @@ -109,7 +109,7 @@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
> # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
>
> ifeq ($(PKG_PLATFORM),linux)
> -PCFLAGS = -D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
> +PCFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
Quoting that man page:
"
_GNU_SOURCE
[...]
Since glibc 2.19, defining _GNU_SOURCE also has the effect
of implicitly defining _DEFAULT_SOURCE. In glibc versions
before 2.20, defining _GNU_SOURCE also had the effect of
implicitly defining _BSD_SOURCE and _SVID_SOURCE.
"
IOWs, glibc is just being an obnoxious. I'd just drop the
-D_BSD_SOURCE altogether, as _GNU_SOURCE should pull in everything
we need. And looking at it further, it also defines _XOPEN_SOURCE to
>= 500, so that could probably be dropped, too.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-04-28 21:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 11:09 xfsprogs compile warnings: _BSD_SOURCE is deprecated in glibc 2.20 Jan Ťulák
2015-04-28 21:12 ` Dave Chinner [this message]
2015-04-29 8:13 ` [PATCH] xfsprogs: Removing deprecated _BSD_SOURCE definition Jan Ťulák
2015-04-29 8:23 ` xfsprogs compile warnings: _BSD_SOURCE is deprecated in glibc 2.20 Jan Tulak
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150428211259.GZ21261@dastard \
--to=david@fromorbit.com \
--cc=jtulak@redhat.com \
--cc=xfs@oss.sgi.com \
/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