IBM Support

IJ36395: XLCLANG CONFLICTS WITH /USR/INCLUDE/SYS/SOCKET.H

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • When compiling the following test case, the compiler issues the
    error messages mentioned below:
    
    ===== COMPILE COMMAND:
    xlclang++ socket_fun.cpp
    
    ===== TESTCASE:
    $ cat socket_fun.cpp
    #include <sys/socket.h> int main(int argc, char** argv) { return
    0; }
    $
    
    
    ===== ACTUAL OUTPUT:
    /opt/IBM/xlC/16.1.0/include2/aix/sys/socket.h:41:5: error:
    declaration of 'accept' has a different language linkage
    int accept(int __socketfd, struct sockaddr *__address, socklen_t
    *__address_len) __asm__("naccept");
        ^
    /usr/include/sys/socket.h:125:18: note: previous definition is
    here
    _FAST_INLINE int accept(int socketfd, struct sockaddr *address,
    socklen_t *address_len)
                     ^
    In file included from socket_fun.cpp:1:
    /opt/IBM/xlC/16.1.0/include2/aix/sys/socket.h:42:5: error:
    declaration of 'getpeername' has a different language linkage
    int getpeername(int __socketfd, struct sockaddr *__address,
    socklen_t *__address_len) __asm__("ngetpeername");
        ^
    /usr/include/sys/socket.h:129:18: note: previous definition is
    here
    _FAST_INLINE int getpeername(int socketfd, struct sockaddr
    *address,
                     ^
    In file included from socket_fun.cpp:1:
    /opt/IBM/xlC/16.1.0/include2/aix/sys/socket.h:43:5: error:
    declaration of 'getsockname' has a different language linkage
    int getsockname(int __socketfd, struct sockaddr *__address,
    socklen_t *__address_len) __asm__("ngetsockname");
        ^
    /usr/include/sys/socket.h:134:18: note: previous definition is
    here
    _FAST_INLINE int getsockname(int socketfd, struct sockaddr
    *address,
                     ^
    In file included from socket_fun.cpp:1:
    /opt/IBM/xlC/16.1.0/include2/aix/sys/socket.h:44:9: error:
    declaration of 'recvfrom' has a different language linkage
    ssize_t recvfrom(int __socketfd, void *__buffer, size_t
    __length, int __flags,
            ^
    /usr/include/sys/socket.h:139:22: note: previous definition is
    here
    _FAST_INLINE ssize_t recvfrom(int socketfd, void *buffer, size_t
    length, int flags,
                         ^
    In file included from socket_fun.cpp:1:
    /opt/IBM/xlC/16.1.0/include2/aix/sys/socket.h:49:9: error:
    declaration of 'recvmsg' has a different language linkage
    ssize_t recvmsg(int __socketfd, struct msghdr *__message, int
    __flags) __asm__("nrecvmsg");
            ^
    /usr/include/sys/socket.h:149:22: note: previous definition is
    here
    _FAST_INLINE ssize_t recvmsg(int socketfd, struct msghdr
    *message, int flags)
                         ^
    In file included from socket_fun.cpp:1:
    /opt/IBM/xlC/16.1.0/include2/aix/sys/socket.h:50:9: error:
    declaration of 'sendmsg' has a different language linkage
    ssize_t sendmsg(int __socketfd, const struct msghdr *__message,
    int __flags) __asm__("nsendmsg");
            ^
    /usr/include/sys/socket.h:153:22: note: previous definition is
    here
    _FAST_INLINE ssize_t sendmsg(int socketfd, const struct msghdr
    *message, int flags)
                         ^
    6 errors generated.
    Error while processing socket_fun.cpp.
    
    ===== EXPECTED OUTPUT:
    Clean compile
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users who include socket.h prior to other system headers are
    affected by this issue.
    
    PROBLEM DESCRIPTION:
    There is a socket.h wrapper header that references _ALL_SOURCE,
    which is not defined on entry but becomes defined during the
    include_next to socket.h.
    This causes the socket.h wrapper header to preprocess
    incorrectly.
    

Problem conclusion

  • The socket.h wrapper header is fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ36395

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    G10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2021-12-10

  • Closed date

    2021-12-13

  • Last modified date

    2021-12-13

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"G10"}]

Document Information

Modified date:
14 December 2021