From: "Jₑₙₛ Gustedt" <jens.gustedt@inria.fr>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [C23 printf 2/3] C23: implement the wN length specifiers for printf
Date: Mon, 29 May 2023 21:21:55 +0200 [thread overview]
Message-ID: <20230529212155.583e2ab7@inria.fr> (raw)
In-Reply-To: <20230529154640.GT4163@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
Rich,
on Mon, 29 May 2023 11:46:40 -0400 you (Rich Felker <dalias@libc.org>)
wrote:
> On Mon, May 29, 2023 at 09:14:13AM +0200, Jₑₙₛ Gustedt wrote:
> > Rich,
> >
> > on Fri, 26 May 2023 17:03:58 -0400 you (Rich Felker
> > <dalias@libc.org>) wrote:
> >
> > > I think you need an extra state that's "plain but not bare" that
> > > duplicates only the integer transitions out of it, like the l, ll,
> > > etc. prefix states do.
> >
> > Hm, the problem is that for the other prefixes the table entries
> > then encode the concrete type that is to be expected. We could not
> > do this here because the type depends on the requested width. So we
> > would then need to "repair" that type after the loop. A `switch` to
> > do that would look substantially similar to what is there, now. Do
> > you think that would be better?
>
> OK I think I can communicate better with code than natural language
> text, so here's a diff, completely untested, of what I had in mind.
that's ... ugh ... not so prety, I think
In my current version I track the desired width, if there is w
specifier, and then do the adjustments after the loop. That takes
indeed care of undefined character sequences.
I find that much better readable, and also easier to extend (later
there comes the `wf` case and the `128`, and perhaps some day `256`)
Jₑₙₛ
--
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2023-05-29 19:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 19:41 [musl] [C23 printf 0/3] Jens Gustedt
2023-05-26 19:41 ` [musl] [C23 printf 1/3] C23: implement the b and B printf specifiers Jens Gustedt
2023-05-26 19:41 ` [musl] [C23 printf 2/3] C23: implement the wN length specifiers for printf Jens Gustedt
2023-05-26 20:31 ` Rich Felker
2023-05-26 20:51 ` Jₑₙₛ Gustedt
2023-05-26 21:03 ` Rich Felker
2023-05-29 7:14 ` Jₑₙₛ Gustedt
2023-05-29 15:46 ` Rich Felker
2023-05-29 19:21 ` Jₑₙₛ Gustedt [this message]
2023-05-30 1:48 ` Rich Felker
2023-05-30 6:46 ` Jₑₙₛ Gustedt
2023-05-30 17:28 ` Rich Felker
2023-05-30 18:00 ` Rich Felker
2023-05-31 7:59 ` Jₑₙₛ Gustedt
2023-06-02 14:29 ` Rich Felker
2023-06-02 14:55 ` Jₑₙₛ Gustedt
2023-06-02 15:07 ` Rich Felker
2023-05-26 19:41 ` [musl] [C23 printf 3/3] C23: implement the wfN length modifiers " Jens Gustedt
2023-05-26 20:33 ` Rich Felker
2023-05-26 21:00 ` Jₑₙₛ Gustedt
[not found] <cover.1685429467.git.Jens.Gustedt@inria.fr>
2023-05-30 6:55 ` [musl] [C23 printf 2/3] C23: implement the wN length specifiers " Jens Gustedt
2023-06-02 14:38 ` Rich Felker
2023-06-02 15:09 ` Jₑₙₛ Gustedt
2023-06-02 15:16 ` Rich Felker
2023-06-02 15:37 ` Jₑₙₛ Gustedt
2023-05-31 14:04 [musl] [C23 printf 0/3] to be replaced Jens Gustedt
2023-05-31 14:04 ` [musl] [C23 printf 2/3] C23: implement the wN length specifiers for printf Jens Gustedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230529212155.583e2ab7@inria.fr \
--to=jens.gustedt@inria.fr \
--cc=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).