Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Michael S Newsgroups: comp.lang.c Subject: Re: tcc - first impression. Was: Baby X is bor nagain Date: Tue, 2 Jul 2024 17:55:59 +0300 Organization: A noiseless patient Spider Lines: 66 Message-ID: <20240702175559.00002a23@yahoo.com> References: <20240624160941.0000646a@yahoo.com> <20240624181006.00003b94@yahoo.com> <20240625113616.000075e0@yahoo.com> <87ed8jnbmf.fsf@bsb.me.uk> <867ceadtih.fsf@linuxsc.com> <20240701200924.00003d9a@yahoo.com> <87zfr0wzpt.fsf@nosuchdomain.example.com> <20240702115448.00002025@yahoo.com> <20240702162704.00002669@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Tue, 02 Jul 2024 16:55:37 +0200 (CEST) Injection-Info: dont-email.me; posting-host="5fbca3f539c7d7fdf38abe2835a4f1fd"; logging-data="1652684"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zwBRowpYQXrR8JdH3CwRD34g/c3frYnw=" Cancel-Lock: sha1:XFmogdXT+3SnLwB2gvNza/sy7mM= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 3984 On Tue, 2 Jul 2024 15:18:10 +0100 bart wrote: > On 02/07/2024 14:27, Michael S wrote: > > On Tue, 2 Jul 2024 12:22:53 +0100 > > bart wrote: > >> > >> Both make use of msvcrt.dll. I don't consider it a dependency since > >> it has always been part of Windows. (I first starting using it in > >> 1990s, from my other language, before I knew much about C, as it > >> had a simpler file API than Windows.) > >> > >> Lots of other applications use it too. Including older gcc binaries > >> and applications compiled with those. > >> > >> On Windows 11, probably 10 too, msvcrt.dll's printf routines > >> support %zu, and so does Tcc. > >> > > > > Not really. > > DLL that supports newer feature has different name - > > VCRUNTIME140.dll And choice of DLL version is not directly related > > to the version of Windows. > Well, both tcc and mcc (my product) import msvcrt, not that runtime > file, and printf/zu works. > > You can test it directly using the program below if you like. > > If you think that the OS craftily substitutues vcruntime140.dll in > place of msvcrt.dll, then copy "c:\windows\system32\msvcrt.dll" to > "fred.dll", to a folder where it can be found. Then change "msvcrt" > beflow to "fred". > > If %zu it doesn't work, then maybe your copy is old. > > --------------------------- > #include > #include > > int main(void) { > int (*PRINTF)(const char*, ...); > HINSTANCE libinst; > > libinst=LoadLibrary("msvcrt"); > if (libinst==NULL) exit(1); > > PRINTF=GetProcAddress(libinst, "printf"); > if (PRINTF==NULL) exit(1); > > PRINTF("sizeof void* = %zu\n", sizeof(void*)); > } > --------------------------- > I am not logged into Win10/11 right now, so tried on Ws2016 witch is mostly the same as early Win10. It didn't work. Then I went and tested on Ws2019 which is similar to midlife Windows 10. It works. I didn't [yet] try to mess with DLLs in system folder but I looked at versions. on Ws2016 - 7.0.14393.2457 on Ws2019 - 7.0.17763.475