On Friday 31 December 2021 00:30:37 Jacek Caban wrote:
> On 12/29/21 16:52, Martin Storsjö wrote:
> > On Wed, 29 Dec 2021, LIU Hao wrote:
> > 
> > > 在 2021-12-23 22:20, Pali Rohár 写道:
> > > > Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf()
> > > > function. Therefore usage of snprintf() with this DLL library cause
> > > > application crash. Add simple fallback implementation of
> > > > _vscprintf() just
> > > > for __ms_vsnprintf() to allow usage of snprintf() function also
> > > > when using
> > > > original msvcrt.dll library. This fallback implementation is
> > > > static and not
> > > > exported outside of vsnprintf.c source file.
> > > > ---
> > > >   mingw-w64-crt/stdio/vsnprintf.c | 67
> > > > +++++++++++++++++++++++++++++++++
> > > >   1 file changed, 67 insertions(+)
> > > > 
> > > 
> > > I have an impression that we have not been supporting for VC6 since
> > > many years ago. All code targeting MSVCRT now requires Windows XP
> > > and the MSVCRT.DLL from it.
> > 
> > While this is true in general, I'm not totally opposed to such a fairly
> > nonintrusive workaround, if it makes things work in more cases with the
> > original msvcrt.dll (and while we can't guarantee that it stays
> > working). But I'm interested in hearing more opinions. Jacek?
> 
> 
> I'm not sure if we ever formalized treatment for old architectures, my
> impression is that we stopped carrying about them in reviews, but never
> cleaned up the tree so we never intentionally broke them. If we keep similar
> code anyway, a non-intrusive workaround seems fine. If we decided to use
> something like that, we should probably just hook _vscprintf like we do with
> other functions, through.

Well, if you want from me any improvements in this patch, I can do it.
Just let me know what is needed to fix/change.

> However, cleaning the code from such workarounds seems tempting. I wonder if
> there is a real use case for this or is it just an experiment for fun?

There is a real use case to allow writing new DLL plugins with modern
mingw-w64 tools for older applications which were compiled with VC6 (and
which use VC6 msvcrt.dll).

Another real use case for which I used this my patch in last few days
was finalizing windows port of pciutils project, specially lspci.exe
command line application which prints all PCI(e) devices in system with
configuration, resources, etc... Because older windows versions (which
has only VC6 msvcrt) have radically smaller hard disk image and need
less runtime memory, I used them in VM (qemu+kvm) with HDD image in RAM
for testing lspci port.

So ability to run binaries compiled by mingw-w64 with VC6 msvcrt runtime
library is a big advantage for me.


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to