Message ID | 20180720025038.9365-2-honli@redhat.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On 7/19/2018 10:50 PM, Honggang LI wrote: > From: Honggang Li <honli@redhat.com> > > grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e 's/-D_BSD_SOURCE=1/-D_DEFAULT_SOURCE=1/' -i {} My understanding is that DEFAULT_SOURCE is glibc 2.19 or later and that glibc 2.19 or later doesn't warn if both BSD_SOURCE and DEFAULT_SOURCE are both defined. So shouldn't this define both ? grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e 's/-D_BSD_SOURCE=1/-D_BSD_SOURCE=1 -D_DEFAULT_SOURCE=1/' -i {} -- Hal > Signed-off-by: Honggang Li <honli@redhat.com> > --- > complib/Makefile.am | 2 +- > opensm/Makefile.am | 2 +- > osmeventplugin/Makefile.am | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/complib/Makefile.am b/complib/Makefile.am > index 70e5681b4c86..df44c0bdb776 100644 > --- a/complib/Makefile.am > +++ b/complib/Makefile.am > @@ -9,7 +9,7 @@ else > DBGFLAGS = -g > endif > > -libosmcomp_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 > +libosmcomp_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 > > if HAVE_LD_VERSION_SCRIPT > libosmcomp_version_script = -Wl,--version-script=$(srcdir)/libosmcomp.map > diff --git a/opensm/Makefile.am b/opensm/Makefile.am > index 86975d3f2147..260d6d298647 100644 > --- a/opensm/Makefile.am > +++ b/opensm/Makefile.am > @@ -1,7 +1,7 @@ > > AM_CPPFLAGS = $(OSMV_INCLUDES) $(METIS_INCLUDES) > > -AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 > +AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 > > lib_LTLIBRARIES = libopensm.la > > diff --git a/osmeventplugin/Makefile.am b/osmeventplugin/Makefile.am > index 01eeb0b0932d..ab42023a5220 100644 > --- a/osmeventplugin/Makefile.am > +++ b/osmeventplugin/Makefile.am > @@ -10,7 +10,7 @@ else > DBGFLAGS = -g > endif > > -libosmeventplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 > +libosmeventplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 > > if HAVE_LD_VERSION_SCRIPT > libosmeventplugin_version_script = -Wl,--version-script=$(srcdir)/libosmeventplugin.map > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Jul 23, 2018 at 12:17:42PM -0400, Hal Rosenstock wrote: > On 7/19/2018 10:50 PM, Honggang LI wrote: > > From: Honggang Li <honli@redhat.com> > > > > grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e 's/-D_BSD_SOURCE=1/-D_DEFAULT_SOURCE=1/' -i {} > > My understanding is that DEFAULT_SOURCE is glibc 2.19 or later and that glibc 2.19 or later doesn't warn if both BSD_SOURCE and DEFAULT_SOURCE are both defined. So shouldn't this define both ? Yes, you are right. Confirmed gcc-8 works when both defined. thanks > > grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e 's/-D_BSD_SOURCE=1/-D_BSD_SOURCE=1 -D_DEFAULT_SOURCE=1/' -i {} > > -- Hal > > > Signed-off-by: Honggang Li <honli@redhat.com> > > --- > > complib/Makefile.am | 2 +- > > opensm/Makefile.am | 2 +- > > osmeventplugin/Makefile.am | 2 +- > > 3 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/complib/Makefile.am b/complib/Makefile.am > > index 70e5681b4c86..df44c0bdb776 100644 > > --- a/complib/Makefile.am > > +++ b/complib/Makefile.am > > @@ -9,7 +9,7 @@ else > > DBGFLAGS = -g > > endif > > > > -libosmcomp_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 > > +libosmcomp_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 > > > > if HAVE_LD_VERSION_SCRIPT > > libosmcomp_version_script = -Wl,--version-script=$(srcdir)/libosmcomp.map > > diff --git a/opensm/Makefile.am b/opensm/Makefile.am > > index 86975d3f2147..260d6d298647 100644 > > --- a/opensm/Makefile.am > > +++ b/opensm/Makefile.am > > @@ -1,7 +1,7 @@ > > > > AM_CPPFLAGS = $(OSMV_INCLUDES) $(METIS_INCLUDES) > > > > -AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 > > +AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 > > > > lib_LTLIBRARIES = libopensm.la > > > > diff --git a/osmeventplugin/Makefile.am b/osmeventplugin/Makefile.am > > index 01eeb0b0932d..ab42023a5220 100644 > > --- a/osmeventplugin/Makefile.am > > +++ b/osmeventplugin/Makefile.am > > @@ -10,7 +10,7 @@ else > > DBGFLAGS = -g > > endif > > > > -libosmeventplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 > > +libosmeventplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 > > > > if HAVE_LD_VERSION_SCRIPT > > libosmeventplugin_version_script = -Wl,--version-script=$(srcdir)/libosmeventplugin.map > > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Jul 23, 2018 at 12:17:42PM -0400, Hal Rosenstock wrote: > On 7/19/2018 10:50 PM, Honggang LI wrote: > > From: Honggang Li <honli@redhat.com> > > > > grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e 's/-D_BSD_SOURCE=1/-D_DEFAULT_SOURCE=1/' -i {} > > My understanding is that DEFAULT_SOURCE is glibc 2.19 or later and that glibc 2.19 or later doesn't warn if both BSD_SOURCE and DEFAULT_SOURCE are both defined. So shouldn't this define both ? > > grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e > 's/-D_BSD_SOURCE=1/-D_BSD_SOURCE=1 -D_DEFAULT_SOURCE=1/' -i {} You should just use _GNU_SOURCE which turns on every extension. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 7/24/2018 10:49 AM, Jason Gunthorpe wrote: > On Mon, Jul 23, 2018 at 12:17:42PM -0400, Hal Rosenstock wrote: >> On 7/19/2018 10:50 PM, Honggang LI wrote: >>> From: Honggang Li <honli@redhat.com> >>> >>> grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e 's/-D_BSD_SOURCE=1/-D_DEFAULT_SOURCE=1/' -i {} >> >> My understanding is that DEFAULT_SOURCE is glibc 2.19 or later and that glibc 2.19 or later doesn't warn if both BSD_SOURCE and DEFAULT_SOURCE are both defined. So shouldn't this define both ? >> >> grep -r -l '\-D_BSD_SOURCE=1' | xargs -I {} sed -e >> 's/-D_BSD_SOURCE=1/-D_BSD_SOURCE=1 -D_DEFAULT_SOURCE=1/' -i {} > > You should just use _GNU_SOURCE which turns on every extension. Revised version of Honggang's patch to follow shortly. -- Hal > Jason > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/complib/Makefile.am b/complib/Makefile.am index 70e5681b4c86..df44c0bdb776 100644 --- a/complib/Makefile.am +++ b/complib/Makefile.am @@ -9,7 +9,7 @@ else DBGFLAGS = -g endif -libosmcomp_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 +libosmcomp_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 if HAVE_LD_VERSION_SCRIPT libosmcomp_version_script = -Wl,--version-script=$(srcdir)/libosmcomp.map diff --git a/opensm/Makefile.am b/opensm/Makefile.am index 86975d3f2147..260d6d298647 100644 --- a/opensm/Makefile.am +++ b/opensm/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(OSMV_INCLUDES) $(METIS_INCLUDES) -AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 +AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 lib_LTLIBRARIES = libopensm.la diff --git a/osmeventplugin/Makefile.am b/osmeventplugin/Makefile.am index 01eeb0b0932d..ab42023a5220 100644 --- a/osmeventplugin/Makefile.am +++ b/osmeventplugin/Makefile.am @@ -10,7 +10,7 @@ else DBGFLAGS = -g endif -libosmeventplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 +libosmeventplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE=1 if HAVE_LD_VERSION_SCRIPT libosmeventplugin_version_script = -Wl,--version-script=$(srcdir)/libosmeventplugin.map