Make printf safe

monkyyy crazymonkyyy at gmail.com
Sat Jul 13 23:54:43 UTC 2024


On Saturday, 13 July 2024 at 20:39:32 UTC, Walter Bright wrote:
> printf

I basically never use the old c printf syntax and Im pretty sure 
thats true of 95% of people here, as far as I know theres one 
usecase for printf and thats picking float significant digits.

Printing in a template lang with a pretty solid print api norm(as 
far as I know everyone on board with toString) have far better 
methods then the c norms. Templates and a lib level decisions 
should be the way forward; now if you want to make those 
better(such as handling the float digit overloads) this would be 
a point of interest for me

Off the top of my head, you should*nt* verify c formated strings 
at all, those cryptic letters are form a very long dead era; if 
your changing the api but want to make it follow to old way, drop 
everything but '%' scanning i.e. `printf("hello %, today is 
%.\n","bob",days.monday);`



More information about the dip.ideas mailing list