Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240801063056.GR10433@brightrain.aerifal.cx>
Date: Thu, 1 Aug 2024 02:30:56 -0400
From: Rich Felker <dalias@...c.org>
To: Oliver Webb <aquahobbyist@...ton.me>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] POSIX 2024: strptime %F

On Thu, Aug 01, 2024 at 04:43:17AM +0000, Oliver Webb wrote:
> I think I have discovered a way to implement strptime %s, %U, etc,
> with function pointers to call back to code after numeric_range is
> done (i.e "if (after) after(*dest, tm)" at the end of the
> numeric_range code with "after" being a function pointer set in a
> case statement).
> 
> This, however, would add a fair amount of complexity to the code
> (multiple static functions in src/time/strptime.c). I can implement
> it without much trouble. But I wanna know if this complexity is
> considered worth it before I put effort into implementing/testing
> it. Maybe there's a alternative way to do it without duplicating
> code or splitting functions?

See commit fced99e93daeefb0192fd16304f978d4401d1d77 which already did
all of the new specifiers.

You seem to be overlooking that the new additions to POSIX do not
specify doing any kind of conversion for these specifiers, just
parsing (the effect on the struct tm is unspecified).

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.