Chanho Park
2014-Sep-25 07:51 UTC
[syslinux] [PATCH] define _DEFAULT_SOURCE for glibc-2.20
Hi,> -----Original Message----- > From: Ferenc Wagner [mailto:wferi at niif.hu] > Sent: Thursday, September 25, 2014 4:42 PM > To: Chanho Park > Cc: syslinux at zytor.com > Subject: Re: [syslinux] [PATCH] define _DEFAULT_SOURCE for glibc-2.20 > > Chanho Park <chanho61.park at samsung.com> writes: > > > _BSD_SOURCE was deprecated in favour of _DEFAULT_SOURCE since glibc > > 2.20[1]. To avoid build warning on glibc2.20, _DEFAULT_SOURCE should > > also be defined. > > Why exactly is _BSD_SOURCE (or _DEFAULT_SOURCE) needed in the Syslinux > sources? Maybe it would be worth pointing out in a comment.Actually, I tried to remove _BSD_SOURCE because I think it's unnecessary flags. However, I'm not sure whether the removing is correct or not. Please look this mail thread[1]. [1]: http://www.syslinux.org/archives/2014-September/022643.html Best Regards, Chanho Park
On Thu, Sep 25, 2014 at 3:51 AM, Chanho Park <chanho61.park at samsung.com> wrote:> Hi, > >> -----Original Message----- >> From: Ferenc Wagner [mailto:wferi at niif.hu] >> Sent: Thursday, September 25, 2014 4:42 PM >> To: Chanho Park >> Cc: syslinux at zytor.com >> Subject: Re: [syslinux] [PATCH] define _DEFAULT_SOURCE for glibc-2.20 >> >> Chanho Park <chanho61.park at samsung.com> writes: >> >> > _BSD_SOURCE was deprecated in favour of _DEFAULT_SOURCE since glibc >> > 2.20[1]. To avoid build warning on glibc2.20, _DEFAULT_SOURCE should >> > also be defined. >> >> Why exactly is _BSD_SOURCE (or _DEFAULT_SOURCE) needed in the Syslinux >> sources? Maybe it would be worth pointing out in a comment. > > Actually, I tried to remove _BSD_SOURCE because I think it's unnecessary > flags. > However, I'm not sure whether the removing is correct or not. > Please look this mail thread[1]. > > [1]: http://www.syslinux.org/archives/2014-September/022643.htmlI mostly questioned it as a matter of "Why was it used in the first place?". Commit 1769d57c94d7a965168b72b6fd8d48251710b452 at tag syslinux-2.00-pre8 (which I'd guess is actually from CVS import) states "Make the syslinux installer be setuid safe (we hope...)". In lieu of HPA voicing up with a more definitive answer and in light of the manpage FEATURE_TEST_MACROS(7): "To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, define both _BSD_SOURCE and _DEFAULT_SOURCE."[1] I'd vote for this additional definition for now. [1]: http://man7.org/linux/man-pages/man7/feature_test_macros.7.html -- -Gene
H. Peter Anvin
2014-Sep-29 19:46 UTC
[syslinux] [PATCH] define _DEFAULT_SOURCE for glibc-2.20
>> >> Actually, I tried to remove _BSD_SOURCE because I think it's unnecessary >> flags. >> However, I'm not sure whether the removing is correct or not. >> Please look this mail thread[1]. >> >> [1]: http://www.syslinux.org/archives/2014-September/022643.html > > I mostly questioned it as a matter of "Why was it used in the first > place?". Commit 1769d57c94d7a965168b72b6fd8d48251710b452 at tag > syslinux-2.00-pre8 (which I'd guess is actually from CVS import) > states "Make the syslinux installer be setuid safe (we hope...)". > > In lieu of HPA voicing up with a more definitive answer and in light > of the manpage FEATURE_TEST_MACROS(7): > > "To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and > _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, > define both _BSD_SOURCE and _DEFAULT_SOURCE."[1] > > I'd vote for this additional definition for now. >I believe it was added for setreuid(). Note that support for running syslinux setuid has long since been removed. -hpa