%m, #614

Gary E. Miller gem at rellim.com
Thu Aug 29 17:48:32 UTC 2019


Yo Achim!

On Thu, 29 Aug 2019 07:53:23 +0200
Achim Gratz via devel <devel at ntpsec.org> wrote:

> Gary E. Miller via devel writes:
> >> But this thread is about that exact function.  
> >
> > We'll have to disagree there.  I feel it is much more generic to
> > the defines that pull in stuff.  
> 
> THen change the subject or open your own thread, please.

Nope.

> >> > Not at all what I meant.  Flexible about what NTPsec builds on,
> >> > not flexible about the end result.    
> >> 
> >> You were arguing for defining _GNU_SOURCE, were you not?  
> >
> > Nope.  
> 
> Yes you were.  You claim Humpty-Dumpty privileges a lot, so just to
> remind you of your exact words:
> 
> --8<---------------cut here---------------start------------->8---
> _GNU_SOURCE should not always be defined, but it does need to be
> defined in certain cases.  For example, on glibc < 2.10, you need to
> define it to get strnlen() and struct ifreq.
> 
> From glibc 2.10, you instead need _POSIX_C_SOURCE >= 200809L
> --8<---------------cut here---------------end--------------->8---

Yup, that's what I said.  It is the trut4h direct from the strnlen()
man page.  And your point is?

> >> Yet you keep arguing that _GNU_SOURCE should or could be defined,  
> >
> > Uh, no.  I'm not sure who you are arguing with on that.  I'm just
> > reminding folks of things recently learned on gpsd about the feature
> > macro thing.  
> 
> Well, you can do whatever you want in gpsd.

Thank you.

>  This is ntpsec

Wow, what a revelation!

> and even
> if there is an actual need to define _GNU_SOURCE for certain long dead
> versions of glibc (which I doubt, that is just the big sledgehammer to
> pull in everything at once if you don't know what you actually
> wanted/needed), that is no reason to do it in general, exactly because
> it is incompatible with the API that ntpsec is supposed to use.  In
> summary,

Not "long dead".  gpsd keeps running into that issue.

The trick is to use feature macros only when needed.  This subjust came
up because the 'when needed' part needed clarification for NTPsec usage.

> ctx.env.CFLAGS = ["-std=c99", "-D_POSIX_C_SOURCE=202009L",
> "-D_XOPEN_SOURCE=600", "-D_DEFAULT_SOURCE"] + ctx.env.CFLAGS

Oh, that is so wrong, on so many levels, but I'll not mutate this topic
again...

> in wscript is much closer to the API ntpsec claims to use (the older
> non-POSIX API are not explicitly mentioned in the docs, but in use
> they are).  The derfinition of _DEFAULT_SOURCE activates a number of
> BSD and SVID API and on some older systems you might need to use
> _BSD_SOURCE and _SVID_SOURCE instead (in addition should also work).

Yup, sort of, but mutating the topic..  I think gpsd is now a good
example of how to do that correctly, and documented in the SConstruct
file.

This needs to be ripped out and done better, after the next release...

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20190829/0acbbc0c/attachment.bin>


More information about the devel mailing list