bugGNU gettext - Bugs: bug #57725, gettext-0.20.1:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57725: gettext-0.20.1: gettext-tools/gnulib-tests/sys/socket.h improperly redefines socklen_t on mingw32

Submitted by:  Keith Marshall <keithmarshall>
Submitted on:  Sun 02 Feb 2020 01:00:32 PM UTC  
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  Bruno Haible <haible>
Open/Closed:  Open

Tue 30 Jun 2020 01:09:00 AM UTC, comment #1: 
Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sun 02 Feb 2020 01:00:32 PM UTC, original submission:  

In ${top_srcdir}/gettext-tools/gnulib-tests/sys_socket.in.h I see:

# if @HAVE_WINSOCK2_H@
/* Include headers needed by the emulation code.  */
#  include <sys/types.h>
#  include <io.h>

#  if !GNULIB_defined_socklen_t
typedef int socklen_t;
#   define GNULIB_defined_socklen_t 1
#  endif

# endif

Cross-compiling, on my GNU/Linux build-host, for deployment on --host=mingw32, this expands (in gettext-tools/gnulib-tests/sys/socket.h) to:

# if 1
/* Include headers needed by the emulation code.  */
#  include <sys/types.h>
#  include <io.h>

#  if !GNULIB_defined_socklen_t
typedef int socklen_t;
#   define GNULIB_defined_socklen_t 1
#  endif

# endif

This is wrong, on two levels:

  1. On mingw32 hosts, socklen_t is defined (unconditionally) in <ws2tcip.h>; thus it is incorrect to make its possible redefinition conditional on the availability of <winsock2.h>
  1. When this code is compiled, in gettext-tools/gnulib-tests/sockets.c, prior conditional tests on HAVE_WINSOCK_H and HAVE_WS2TCPIP_H have already caused <winsock2.h> and <ws2tcpip.h> respectively to have been included.  Thus, socklen_t will have been defined already, yet the secondary GNULIB_defined_socklen_t condition appears to be false, at this point, causing redefinition, and conflict with the <ws2tcpip.h> definition, (which I recently changed to:

    typedef unsigned int socklen_t;

to avoid many messy casts within the new <wspiapi.h> implementation I needed to add, to allow gcc-ada-9.2.0 to compile with pre-WinXP legacy platform support).

Keith Marshall <keithmarshall>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by keithmarshall (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-30 haible StatusNone => In Progress
        Assigned toNone => haible

    Back to the top


    Powered by Savane 3.5