remove use of printf format %z[d|u] from dmd source#23351
Conversation
|
printf sure seems to demand a lot of work from us. |
|
I made a proposal to have chkformat() automatically replace Then you could do things like: printf("I have %s %s\n", 6, "apples");But nobody was in favor of it. |
There is a much simpler solution to have printf behave like writef... alias printf = writef; |
|
Some reasons why I use printf:
|
Improve your tooling instead of imposing its limitations on everyone else. |
|
|
|
||
| /compiler/backend/old/* | ||
| /compiler/backend/new/* |
There was a problem hiding this comment.
Are these meant to be committed?
There was a problem hiding this comment.
Yes. But I don't know why .gitignore is part of the repository. Is there another name for it so I can have a local .gitignore?
You aren't the only one who needs to see compiler output. I often have to debug my drt0 functions and interrupt handlers. A simple invocation of objdump+awk is all I need to focus on that. With LDC's propensity for silently giving up instead of failing on assembly errors, I do this A LOT. Even when calls to my writef clone are involved, they don't get in my way at all, because all those symbols have been filtered out! I can even combine that with I've even written multiple disassemblers of my own to deal with the REALLY esoteric stuff. I even had a web-based disassembler long ago for a collaborative reverse-engineering effort. You never need to suffer with insufficient tooling. I've had fewer problems with phobos's interdependencies on bare metal than I've had with druntime's. Until I decided to stop using druntime entirely, every time druntime got updated, some random part of it seemed to gain a new dependency on You might not have had to debug printf implementations, but it seems someone had to for this PR! If you're not imposing the requirement to use printf on the compiler, then who is? |
|
If printf doesn't fit your requirements, just don't use it! The choice is yours. As for the 'z' problem with MSVC libraries, I actually knew about it, but I thought it was ancient history. |
|
P.S. I dread having compiler bugs with Phobos. It's always a long slog trying to narrow it down because the absolutely massive object files it generates. This is why I put Phobos as the last step in developing the compiler. |
|
We fixed the problem by upgrading to UCRT, which we really needed to do anyways for a host of other reasons, but this does unblock older |
@LightBender Adam Wilson writes on the n.g.:
I fixed it anyway.