Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230602165547.4174f1cf@inria.fr>
Date: Fri, 2 Jun 2023 16:55:47 +0200
From: Jₑₙₛ Gustedt <jens.gustedt@...ia.fr>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: [C23 printf 2/3] C23: implement the wN length specifiers
 for printf

Rich,

on Fri, 2 Jun 2023 10:29:37 -0400 you (Rich Felker <dalias@...c.org>)
wrote:

> ...

> OK, some numbers. This alt version (with a couple bug fixes and
> support for wf added), vs the full state machine version. On i386,
> using this instead of the full state machine (which is still missing
> 'wf') adds 246 bytes of .text but saves 440 bytes of .rodata. With wf
> added, it will be even more of a win. So I think it makes more sense
> to go with this version.

Ok, sounds promissing. Some remarks

 - I'd still prefer to name the constant `WPRE` instead of `PLAIN` for
   documentation reasons.

 - It seems that your version doesn't capture the leading 0 case. That
   would still need an `if` condition that leads to `invalid`, I
   guess.

> As an aside, since think the state table is the same for wide printf
> as for normal, and since wide printf already depends on normal printf,
> we could make the states table external (but hidden, of course) and
> let wide printf reuse it, for some decent size savings and elimination
> of source-level redundancy (DRY).

Same holds for the `pop_arg` function, which is also repeated.

Thanks
Jₑₙₛ

-- 
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Content of type "application/pgp-signature" skipped

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.