On Thursday 31 July 2025 16:21:26 Martin Storsjö wrote:
> On Sun, 13 Jul 2025, Pali Rohár wrote:
> 
> > All these functions have same declarations in #ifdef _UCRT and #else
> > blocks. The only difference is that in non-UCRT block functions vfwscanf,
> > vswscanf and vwscanf are declared without __cdecl. As all those functions
> > are with __cdecl calling convenion, they should be declared with __cdecl.
> > ---
> > mingw-w64-headers/crt/stdio.h | 23 -----------------------
> > mingw-w64-headers/crt/wchar.h | 26 --------------------------
> > 2 files changed, 49 deletions(-)
> > 
> > diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
> > index ff9a36373d70..721b68463351 100644
> > --- a/mingw-w64-headers/crt/stdio.h
> > +++ b/mingw-w64-headers/crt/stdio.h
> > @@ -1080,8 +1080,6 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
> > wchar_t *__format, __builti
> > #endif /* __NO_ISOCEXT */
> > 
> > #else /* !__USE_MINGW_ANSI_STDIO */
> > -
> > -#ifdef _UCRT
> >   __MINGW_ATTRIB_DEPRECATED_SEC_WARN
> >   int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * 
> > __restrict__ _Format,...);
> > 
> > @@ -1104,27 +1102,6 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
> > wchar_t *__format, __builti
> >   int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
> >   int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * 
> > __restrict__ _Format,va_list _ArgList);
> >   int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list 
> > _ArgList);
> > -#else
> > -
> > -  int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * 
> > __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> > -  int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * 
> > __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> > -  int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) 
> > __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> > -#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
> 
> Note that the other branch didn't have the __NO_ISOCEXT ifdef, so this does
> make a little bit of difference. But I'm not really sure if we care about
> maintaining the use of that define here, and it was already inconsistent for
> UCRT. But it's worth pointing out that these weren't 100% identical, but
> it's worth making them consistent.

Ok. Feel free to adjust a commit message.

Probably __NO_ISOCEXT ifdefs are already wrongly used and on many places
are missing. Also I'm not exactly sure if we know how it should be used
for which functions.

> I'll push this for a round of CI, and if people don't mind, we can probably
> push this. It's always nice to reduce some amount of duplication like this.
> 
> // Martin


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

Reply via email to