On Monday 19 September 2022 15:33:45 Martin Storsjö wrote: > On Sat, 17 Sep 2022, Pali Rohár wrote: > > > --- > > mingw-w64-crt/Makefile.am | 3 +++ > > mingw-w64-crt/stdio/ucrt__scprintf.c | 21 +++++++++++++++++++++ > > mingw-w64-crt/stdio/ucrt__snprintf.c | 21 +++++++++++++++++++++ > > mingw-w64-crt/stdio/ucrt__snscanf.c | 21 +++++++++++++++++++++ > > 4 files changed, 66 insertions(+) > > create mode 100644 mingw-w64-crt/stdio/ucrt__scprintf.c > > create mode 100644 mingw-w64-crt/stdio/ucrt__snprintf.c > > create mode 100644 mingw-w64-crt/stdio/ucrt__snscanf.c > > I fail to see the motivation for these three patches. > > Sure there are inconsistencies currently (how we have a non-inline > _vscprintf today but _scprintf is inline), but for all the existing ones, we > consistently have either inline or extern definition - but not both.
For different checks (like in autoconf) it is needed to have functions linkable/exported from standard library. As these checks are doing linking without including header files. This is reason why there is e.g. snprintf function in mingw-w64 crt library. And for optimizations, it is really not a good idea to use another function wrapper which just call another function. This is reason why functions are defined as inline. > So while some reshuffling might be warranted - if there's a good reason for > it - I'd prefer to make them either entirely inline or entirely extern, when > doing such reshuffling. > > // Martin I think that C99 requires that inline functions need to have also non-inline variant for external linkage. Anyway, my motivation was to build mingw-w64 runtime without dependency on particular msvcrt/ucrt CRT code, so CRT dependent code would be constructed at application compile time. And for this, it is needed that mingw-w64 runtime/helper functions would not use any inline ucrt function, so it would be CRT independent. What do you think about it? _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public