[Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows

2014-11-04 Thread Martell Malone
Hey guys, Can I get some clarification in lfind on x64 not using size_t* but using unsinged int* What is the best course of action to take ? Is there anything that can be done in mingw-w64 Many Thanks Martell -- Forwarded message -- From: RĂ©mi Denis-Courmont r...@remlab.net

Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows

2014-11-04 Thread Kai Tietz
Issue here is that referenced object 'unsigned int' has different size to 'size_t' on Windows. Means that function might set only lower 32-bit to something meaningful, and so passing a size_t pointer to it could lead to corrupted value in it. Kai

Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows

2014-11-04 Thread Martell Malone
Yes I agree with this. Especially because lfind is dynamically linked to msvcrt We didn't into this before on irc but could we add something similar to this in header in mingw64 #define _lfind(a,b,c,d,e) _lfind(a,b,(unsigned int*)c,d,e) Which explicitly casts it to (unsigned int *) Would this

Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows

2014-11-04 Thread Kai Tietz
No, it wouldn't help, as we still have an strict-aliasing issue. And additionally the upper 32-bit of object are containing random values Kai 2014-11-04 17:36 GMT+01:00 Martell Malone martellmal...@gmail.com: Yes I agree with this. Especially because lfind is dynamically linked to msvcrt We

Re: [Mingw-w64-public] Fwd: [vlc-devel] [PATCH] fix lfind errors on windows

2014-11-04 Thread Martell Malone
The definition of the function appears to define num is the number of elements in the table If I am reading this correctly the value of size_t has to be set before calling lfind In this case the upper32 bits are already set to 0. Except in the case where size_t is more than 0x elements