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

Submitter:  Keith Marshall <keithmarshall>
Submitted:  Sun 02 Feb 2020 01:00:32 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Mon 27 Jul 2020 05:45:06 PM UTC, comment #3: 

The fix is contained in gettext 0.21.

Bruno Haible <haible>
Group administrator
Sun 05 Jul 2020 08:46:30 PM UTC, comment #2: 

The fix has now been imported into gettext.

Bruno Haible <haible>
Group administrator
Tue 30 Jun 2020 01:09:00 AM UTC, comment #1: 
Bruno Haible <haible>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2020-07-05 haible StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2020-06-30 haible StatusNone In Progress
        Assigned toNone haible

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code