`mktime` bug in arm-none-eabi-newlib-4.5.0.20241231-1

Gerald Wisböck spamhere@feather.ink
Tue Feb 25 18:15:04 GMT 2025


Hi,
Using `mktime` in arm-none-eabi-newlib-4.5.0.20241231-1 causes a hardfault.

I assume it is related to the extraneous `_tzset_unlocked ();` call.

```c
/* compute total seconds */
   tim += (time_t)days * _SEC_IN_DAY;

   TZ_LOCK;

   _tzset_unlocked (); // This call is bad. I believe only 
TZ_LOCK/TZ_UNLOCK macros should be used if intentional.

   if (_daylight)
   <stuff>
   TZ_UNLOCK; // unlock should happen here
   <stuff>
```

Another user seems to have encountered this issue: 
https://stackoverflow.com/a/63367315/4479969

Is this already fixed?
Can you release a hotfix?

Kind regards,
raldone01


More information about the Newlib mailing list