Re: RFC: inconsistencies/conflicts in <winsock.h>/<winsock2.h>

Earnie via MinGW-dvlpr <[email protected]> Mon, 21 Aug 2017 08:52:30 -0400
Newsgroups gmane.comp.gnu.mingw.devel
Message-ID <[email protected]>
On 8/21/2017 7:54 AM, Keith Marshall via MinGW-dvlpr wrote:
> On 08/08/17 21:57, Keith Marshall via MinGW-dvlpr wrote:
>> 3) The definitions of the FD_SET macro differ between the two headers;
>>    this appears to be intentional, in spite of the <winsock.h> version
>>    being utterly broken.  I don't know what Microsoft do, in *their*
>>    <winsock.h>, but similar breakage does appear to be perpetuated in
>>    other open source implementations; should we fix it, or should we
>>    continue to mimic the broken behaviour perpetuated by others?
> 
>> 4) Although the same in both cases, the FD_CLR macro is detrimentally
>>    affected by the broken FD_SET in <winsock.h>; it's actually not
>>    robust in either case, because it doesn't account for any possible
>>    duplication of socket descriptors in the managed descriptor set;
>>    should we seek a more robust formulation?
> 
> I've now created an autotest module which demonstrates these two issues:
> https://sourceforge.net/p/mingw/mingw-org-wsl/ci/a5f7717aa34744b4bb18bf287d9a9920de0f4c30/
> 
> As may be seen, from the attached testsuite output, issue (3) is 
> apparent in the <winsock.h>, but not in the <winsock2.h> implementation, 
> of FD_SET, (although the latter implementation is an utterly ghastly 
> mess).  Issue (4) remains (identically) in both implementations, in the 
> particular case of an fd_set which may be malformed, (perhaps as a 
> result of using FD_SET to add a duplicate fd, in a translation unit 
> which includes <winsock.h> rather than <winsock2.h>).
> 
> Unless anyone can offer a convincing argument, within the next seven 
> days, as to why we should faithfully reproduce other projects' bugs, I 
> propose to correct both of these issues.

Why wait?  The MS documentation doesn't propose this issue so just do it.

-- 
Earnie

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot