public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Best practices in regard to -D_TIME_BITS=64
@ 2022-01-04 23:33 Kaz Kylheku
  2022-01-05  0:49 ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Kaz Kylheku @ 2022-01-04 23:33 UTC (permalink / raw)
  To: libc-alpha

Hi all,

What should be the best practice with regard to selecting the width of 
time_t,
which is possible with newer glibc's -D_TIME_BITS=64?

My main concern is specifically with application developers. Should
individual applications be detecting that this is available and using 
it?

Or is this best left to the toolchain/distro people? If some 32 bit
platform (like an embedded system) decides to go to 64 bit time, that
can be rolled into the default compiler options.

If the application is some free software that is packaged into a distro,
then likewise the package maintainers can decide. They can put it into
the distro-wide CFLAGS, or whatever.

I have some apprehensions about just pulling the trigger and using it
individually; like what if the application is included in some system
where it is the only thing requesting that, and it causes some
interoperability issue with other pieces.

This feels different from _FILE_OFFSET_BITS, because _FILE_OFFSET_BITS
does not solve some impeding problem that becomes worse as we approach
a certain date. A program not manipulating large files never needs to
care, even if it manipulates files; whereas there will hardly be such
a thing as a program which manipulates time and which only needs to
handle "small time" such that it's perfectly fine with a 32 bit time_t
and related structures and functions thereof.

One can force downstream people to deal with this. If the program
detects that it's on a 32 bit platform where time_t is still 32 bits
if no special compiler options are used, and where -D_TIME_BITS=64
is available and working, the configure script can fail and make
the user explicitly decide what they want to do: stick with the
32 bit time, or go to 64.

/That/ could be a best practice.

Hmm, any thoughts?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-05 20:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 23:33 Best practices in regard to -D_TIME_BITS=64 Kaz Kylheku
2022-01-05  0:49 ` Paul Eggert
2022-01-05  0:53   ` Sam James
2022-01-05  4:43     ` Paul Eggert
2022-01-05 20:12       ` Kaz Kylheku

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).