On Thursday 27 June 2024 00:22:53 Martin Storsjö wrote:
> On Wed, 26 Jun 2024, Pali Rohár wrote:
> 
> > > > @@ -2174,21 +2174,21 @@ acos
> > > > F_NON_I386(acosf)
> > > > acosh
> > > > acoshf
> > > > -acoshl F_X86_ANY(DATA)
> > > > +F_ARM_ANY(acoshl) ; Can't use long double functions from the CRT on x86
> > > 
> > > Also contrary to what the commit message made it sound like, most of these
> > > functions were already skipped on x86, but by marking the functions as 
> > > DATA,
> > > while it's arguably more correct/consistent to omit them entirely like 
> > > this
> > > patch does.
> > 
> > Function marked by DATA is still used if the header file contains
> > dllimport attribute.
> 
> Yes of course - but from practical testing by building C code with our
> headers, these imports aren't used, as those functions aren't marked with
> dllimport.
> 
> So from a practical point of view of building a C application, most of these
> functions have already worked correctly.

Yes, that is truth.

I was curious if there is some long double function marked with
dllimport in mingw-w64 header files, and I found something:

$ git grep CRTIMP mingw-w64-headers/ | grep 'long double'
mingw-w64-headers/crt/xlocinfo.h:_CRTIMP long double __cdecl _Stold(const char 
*,char **,long);
mingw-w64-headers/crt/xmath.h:_CRTIMP short __cdecl _LDscale(long double 
*,long);
mingw-w64-headers/crt/xmath.h:_CRTIMP short __cdecl _LDunscale(short *,long 
double *);
mingw-w64-headers/crt/xmath.h:_CRTIMP long double __cdecl _LPoly(long 
double,const long double *,int);
mingw-w64-headers/crt/ymath.h:_CRTIMP long double __cdecl _LCosh(long 
double,long double);
mingw-w64-headers/crt/ymath.h:_CRTIMP short __cdecl _LDtest(long double *);
mingw-w64-headers/crt/ymath.h:_CRTIMP short __cdecl _LExp(long double *,long 
double,short);
mingw-w64-headers/crt/ymath.h:_CRTIMP long double __cdecl _LSinh(long 
double,long double);

But I guess nobody ever used any of those functions.

So practically there is no change.

> > Commenting functions is better as it is not exported at all.
> 
> Yes, of course.
> 
> > > But just for context - this patch shouldn't have much of a practically
> > > observable effect, that aspect was already fixed long ago, this just makes
> > > it consistent with this new pattern for doing it.
> > > 
> > > // Martin
> > 
> > Note that this change disabled also symbols which were not marked as
> > DATA and were exported. E.g. function cimagl(). So there are also some
> > observable changes.
> 
> Yes - but for many of the practically used functions, this already did work
> correctly.
> 
> I'm not saying the change isn't good - it's very good! I'm just reframing
> the scope for readers - someone reading the commit message might get an
> impression that long double math functions didn't work correctly on UCRT
> before at all, in practical use. In real use, things mostly worked fine, but
> this patch make it more consistent and complete (and correct on a technical
> level).
> 
> // Martin

Understood. Anyway, if you think that my commit message are misleading
in some cases, fill free to correct them. I see that sometimes they can
be understood by other people in different way as I originally mean.


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

Reply via email to