dc_datetime function documentation

Jef Driesen jef at libdivecomputer.org
Thu Jan 12 05:44:56 PST 2017


On 2017-01-12 10:50, Kristaps Dzonsons wrote:
> Enclosed is a patch that documents all of the dc_datetime functions.

Looks good, except for one thing:

> The CAVEATS are important because calling gmtime et al from a library
> might not be expected.  (They touch the zoneinfo files, which may not 
> be
> available on embedded or sandboxed systems.)

Why would that be unexpected? They are standard C library functions. I 
see no reason not to use them (and there are basically no easy 
alternatives). If their implementation is broken on some system, then 
that's a libc problem. So if you ask me, this caveats section is not 
necessary and only adds confusion.

PS: I do use the thread-safe variants (e.g. localtime_r and gmtime_r) 
when available.

Jef


More information about the devel mailing list