On Sunday 20 November 2022 17:23:15 Eli Zaretskii wrote:
> > Date: Sun, 20 Nov 2022 16:04:11 +0100
> > From: Pali Rohár <pali.ro...@gmail.com>
> > Cc: gcc@gcc.gnu.org, mingw-w64-pub...@lists.sourceforge.net
> > 
> > On Sunday 20 November 2022 16:45:55 Eli Zaretskii wrote:
> > > > Date: Sun, 20 Nov 2022 13:53:48 +0100
> > > > From: Pali Rohár via Gcc <gcc@gcc.gnu.org>
> > > > 
> > > Linking a program against a specific runtime means the produced binary 
> > > will
> > > not run on Windows systems older than the one where it was linked.  Why is
> > > such a limitation a good idea, may I ask?
> > 
> > It will run also on older Windows system if you install redistributable
> > runtime library. Which in most cases is already installed because other
> > programs use it.
> 
> Installing a redistributable is a nuisance, and dependence on non-system
> libraries might make the program non-free.

On new windows versions they may be preinstalled (depends on newness of
windows version). And if your application uses features unavailable in
older (or default) crt versions then this make application code
simplifier. Also redistributable packages are in most cases installed by
Windows update mechanism, which could be marked as system library. But
well, this is more license discussion than development discussion...

> > And why you want a new version? Because of better C99/C11 support which
> > is in ucrtbase.dll
> 
> That comes with a price, though.
> 
> > Note that with this option, you can also choose older version than the
> > default one (WinXP msvcrt.dll). So e.g. you can choose msvcrt20.dll or
> > crtdll.dll for older Windows version.
> 
> Using the OS default MSVCRT already gets me that, at zero cost.

Here "OS default MSVCRT" means Windows XP MSVCRT.DLL.

On older windows versions there is no pre-installed MSVCRT.DLL. There
is MSVCRT20.DLL or CRTDLL.DLL (based on oldness of windows version). So
it is not at zero cost, you have yo either do that nuisance and install
MSVCRT.DLL as you write above or switch to older CRT version which is in
OS preinstalled.

And proposed gcc parameter -mcrtdll could simplify that switch.

Reply via email to