Skip to content
Snippets Groups Projects

Refactor mktime, timegm and fix wcpncpy test

Merged Peter Limkilde Svendsen requested to merge plimkilde/relibc:mktime-timegm-refactor into master

This is a refactor of mktime() to use a non-iterative algorithm, as well as making it normalize the input struct as specified in POSIX.

The nonstandard timegm() had a duplicate implementation, and now simply calls mktime() (its docs state that "The timelocal() function is equivalent to the POSIX standard function mktime(3). There is no reason to ever use it.").

I am currently running into the following mysterious error during tests:

main: wchar/wcpncpy.c:11: Assertion `*result == L'\0'` failed.
Illegal instruction (core dumped)

It seems entirely unrelated to my changes, and it is apparently caused when introducing the checked arithmetic in line 450. Marking as draft until this is investigated. Appears to be caused by a read from uninitialized memory, relevant assertion disabled.

The wcpncpy() test has been rewritten in 33d7c5a5 to properly exercise its expected behavior.

Edited by Peter Limkilde Svendsen

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading