Rich, on Fri, 2 Jun 2023 10:29:37 -0400 you (Rich Felker ) 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 ::