On Saturday 23 March 2024 22:22:03 LIU Hao wrote:
> 在 2024-03-23 18:43, Pali Rohár 写道:
> > On Monday 11 March 2024 19:02:09 LIU Hao wrote:
> > > 在 2024-03-11 15:52, Pali Rohár 写道:
> > > > I know, but I'm trying to achieve it by small steps. For _scprintf it
> > > > should fix this issue as mingw library starts providing required symbol
> > > > for linking object files. Or do you see there some problem with it?
> > > 
> > > That's acceptable, like 'ucrt_vfprintf.c' for example.
> > 
> > Ok, and this is what the change "crt: Add non-inline variant of UCRT
> > _scprintf, _snprintf and _snscanf functions" is doing. Link:
> > https://sourceforge.net/p/mingw-w64/mailman/message/37708936/
> 
> That single patch causes errors like
> 
> ```
> x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I.  -m32 -masm=att -D__LIBMSVCRT__
> -I./include "-I/ucrt64/include"  -pipe -std=gnu99 -D_CRTBLD
> -D_WIN32_WINNT=0x0f00 -D__MSVCRT_VERSION__=0x700 -D__USE_MINGW_ANSI_STDIO=0
> -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow -Wpacked -Winline
> -Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes -g
> -O2 -c -o stdio/lib32_libucrt_extra_a-ucrt__scprintf.o `test -f
> 'stdio/ucrt__scprintf.c' || echo './'`stdio/ucrt__scprintf.c
> stdio/ucrt__scprintf.c:12:13: error: redefinition of '_scprintf'
>    12 | int __cdecl _scprintf(const char * __restrict__ _Format, ...)
>       |             ^~~~~~~~~
> In file included from stdio/ucrt__scprintf.c:9:
> C:/msys64/ucrt64/include/stdio.h:741:15: note: previous definition of
> '_scprintf' with type 'int(const char * restrict, ...)'
>   741 |   int __cdecl _scprintf(const char * __restrict__ _Format,...)
>       |               ^~~~~~~~~
> ```

I see... The problem is that inline version of that function in stdio.h
conflicts with non-inline version in ucrt__scprintf.c file.

One option how to avoid this problem is to not include stdio.h into
ucrt__scprintf.c file.

Other option can be to remove inline version completely.


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to