Re: 32 bits time_t and Y2038 issue

Liste des GroupesRevenir à ca embedded 
Sujet : Re: 32 bits time_t and Y2038 issue
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.arch.embedded
Date : 14. Mar 2025, 14:20:56
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vr1afo$19unh$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 14/03/2025 13:27, pozz wrote:
Il 13/03/2025 16:51, David Brown ha scritto:
On 13/03/2025 09:57, pozz wrote:
Il 12/03/2025 19:18, David Brown ha scritto:
On 12/03/2025 18:13, pozz wrote:

Ok, but I don't understand why you prefer to write your own code (yes, you're an exper programmer, but you can introduce some bugs, you have to write  some tests), while there are standard functions that make the job for you.
>
>
I prefer to use a newer version of the toolchain that does not have such problems :-)
 Sure, but the project is old. I will check if using a newer toolchain is a feasible solution for this project.
 
I fully appreciate - and agree with - not wanting to change toolchains on an existing established project.  It might be the best solution here, but it is certainly not one to be picked lightly.

 
I am quite happy to re-use known good standard functions.  There is no need to reinvent the wheel if you already have one conveniently available.  But you don't have standard functions conveniently available here - the ones from your toolchain are not up to the task, and you are not happy with the other sources you have found for the standard functions.
>
So once you have eliminated the possibility of using pre-written standard functions, you then need to re-evaluate what you actually need.   And that is much less than the standard functions provide.  So write your own versions to do what you need to do - no more, no less.
 I agree with you. I thought you were suggesting to use custom made functions in any case, because my approach that uses time_t counter (seconds from epoch) and localtime()/mktime() isn't good.
 
No.  I am merely saying that if you can't use the standard functions and have to get other ones from somewhere (or write them yourself), making them match standard function interfaces is of no benefit.  There are many alternative formats that could be better for your use.

 
2. Use an implementation from other library sources online.  You've ruled those out as too complicated.
 In the past I sometimes lurked in the newlib code and it seems too complicated for me. I will search for other simple implementations of localtime()/mktime().
 
There are other C standard libraries around - maybe others are better than newlib for this purpose.  (I don't know if newlib nano is mixed in with newlib here.)  Newlib sources are, at least in parts, a monstrosity of conditional compilation to support vast numbers of targets, compilers, OS's, and options.

 
3. Write your own functions.  Yes, that involves a certain amount of work, testing and risk.  That's your job.
>
Am I missing anything?
 I don't think.
 
I really hope you missed a word in that sentence :-)

Date Sujet#  Auteur
11 Mar 25 * 32 bits time_t and Y2038 issue55pozz
11 Mar 25 `* Re: 32 bits time_t and Y2038 issue54David Brown
11 Mar 25  +* Re: 32 bits time_t and Y2038 issue10pozz
12 Mar 25  i`* Re: 32 bits time_t and Y2038 issue9David Brown
12 Mar 25  i `* Re: 32 bits time_t and Y2038 issue8pozz
12 Mar 25  i  `* Re: 32 bits time_t and Y2038 issue7David Brown
12 Mar 25  i   `* Re: 32 bits time_t and Y2038 issue6pozz
12 Mar 25  i    `* Re: 32 bits time_t and Y2038 issue5David Brown
13 Mar 25  i     `* Re: 32 bits time_t and Y2038 issue4pozz
13 Mar 25  i      `* Re: 32 bits time_t and Y2038 issue3David Brown
14 Mar 25  i       `* Re: 32 bits time_t and Y2038 issue2pozz
14 Mar 25  i        `- Re: 32 bits time_t and Y2038 issue1David Brown
12 Mar 25  +* Re: 32 bits time_t and Y2038 issue4pozz
12 Mar 25  i+- Re: 32 bits time_t and Y2038 issue1David Brown
14 Mar 25  i`* Re: 32 bits time_t and Y2038 issue2Waldek Hebisch
14 Mar 25  i `- Re: 32 bits time_t and Y2038 issue1pozz
15 Mar 25  `* Re: 32 bits time_t and Y2038 issue39Michael Schwingen
15 Mar 25   +* Re: 32 bits time_t and Y2038 issue2Grant Edwards
16 Mar 25   i`- Re: 32 bits time_t and Y2038 issue1Michael Schwingen
18 Mar 25   `* Re: 32 bits time_t and Y2038 issue36pozz
18 Mar 25    +* Re: 32 bits time_t and Y2038 issue34David Brown
18 Mar 25    i+* Re: 32 bits time_t and Y2038 issue7pozz
18 Mar 25    ii`* Re: 32 bits time_t and Y2038 issue6David Brown
21 Mar 25    ii `* Re: 32 bits time_t and Y2038 issue5Michael Schwingen
21 Mar 25    ii  +* Re: 32 bits time_t and Y2038 issue3David Brown
21 Mar 25    ii  i`* Re: 32 bits time_t and Y2038 issue2Michael Schwingen
22 Mar 25    ii  i `- Re: 32 bits time_t and Y2038 issue1David Brown
21 Mar 25    ii  `- Re: 32 bits time_t and Y2038 issue1Waldek Hebisch
18 Mar 25    i`* Re: 32 bits time_t and Y2038 issue26Michael Schwingen
18 Mar 25    i `* Re: 32 bits time_t and Y2038 issue25David Brown
18 Mar 25    i  +* Re: 32 bits time_t and Y2038 issue15Grant Edwards
18 Mar 25    i  i+* Re: 32 bits time_t and Y2038 issue13Hans-Bernhard Bröker
19 Mar 25    i  ii+* Re: 32 bits time_t and Y2038 issue10David Brown
19 Mar 25    i  iii`* Re: 32 bits time_t and Y2038 issue9Grant Edwards
19 Mar 25    i  iii `* Re: 32 bits time_t and Y2038 issue8David Brown
19 Mar 25    i  iii  +* Re: 32 bits time_t and Y2038 issue4Grant Edwards
19 Mar 25    i  iii  i`* Re: 32 bits time_t and Y2038 issue3David Brown
21 Mar 25    i  iii  i `* Re: 32 bits time_t and Y2038 issue2Michael Schwingen
21 Mar 25    i  iii  i  `- Re: 32 bits time_t and Y2038 issue1Grant Edwards
19 Mar 25    i  iii  `* Re: 32 bits time_t and Y2038 issue3Waldek Hebisch
20 Mar 25    i  iii   `* Re: 32 bits time_t and Y2038 issue2David Brown
21 Mar 25    i  iii    `- Re: 32 bits time_t and Y2038 issue1pozz
21 Mar 25    i  ii`* Re: 32 bits time_t and Y2038 issue2Michael Schwingen
21 Mar 25    i  ii `- Re: 32 bits time_t and Y2038 issue1Hans-Bernhard Bröker
19 Mar 25    i  i`- Re: 32 bits time_t and Y2038 issue1David Brown
21 Mar 25    i  `* Re: 32 bits time_t and Y2038 issue9Waldek Hebisch
21 Mar 25    i   `* Re: 32 bits time_t and Y2038 issue8David Brown
21 Mar 25    i    +- Re: 32 bits time_t and Y2038 issue1pozz
22 Mar 25    i    +* Re: 32 bits time_t and Y2038 issue4Hans-Bernhard Bröker
22 Mar 25    i    i`* Re: 32 bits time_t and Y2038 issue3David Brown
22 Mar 25    i    i `* Re: 32 bits time_t and Y2038 issue2Michael Schwingen
22 Mar 25    i    i  `- Re: 32 bits time_t and Y2038 issue1David Brown
22 Mar 25    i    `* Re: 32 bits time_t and Y2038 issue2Waldek Hebisch
22 Mar 25    i     `- Re: 32 bits time_t and Y2038 issue1David Brown
18 Mar 25    `- Re: 32 bits time_t and Y2038 issue1Michael Schwingen

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal