Skip to content

AIX: sendmmsg and recvmmsg get implicit declartion #30806

@abmusse

Description

@abmusse

Hello everyone I know this issue is closed but I'm hitting a issue that is related.

In Node.js I have PR that updates the compiler to Clang: nodejs/node#62656

AIX header files don't ship declarations for sendmmsg and related functions, despite documentation showing they should be included. This appears to be a bug in AIX header files.

GCC tolerates implicit function declarations, but Clang 16+ treats them as errors:
https://www.redhat.com/en/blog/new-warnings-and-errors-clang-16

For now, we claim to not have these functions. The actual functions are available in libc, so an alternative would be to declare them ourselves for AIX 7.2+.

I agree with @Enc-EE comment in #23751 (comment)

I looked into this a bit more and want to share some information.
The sendmmsg and recvmmsg are defined in net/proto_uipc.h
Doesn't look like this file will be included when including sys/socket.h so I included it manually.

Shouldn't the fix really be adding #include <net/proto_uipc.h> in this conditional?

makr73@e40a810#diff-a818fa04807217bec0c2885bab4598ec7658fb32eac750f1525e2653ef925cc7R71-R75

Otherwise these functions won't be found and implict declaration would be used.

16:55:13 ../deps/openssl/openssl/crypto/bio/bss_dgram.c: In function 'dgram_sendmmsg':
16:55:13 ../deps/openssl/openssl/crypto/bio/bss_dgram.c:1416:11: warning: implicit declaration of function 'sendmmsg'; did you mean 'sendmsg'? [-Wimplicit-function-declaration]
16:55:14  1416 |     ret = sendmmsg(b->num, mh, num_msg, sysflags);
16:55:14       |           ^~~~~~~~
16:55:14       |           sendmsg
16:55:14 ../deps/openssl/openssl/crypto/bio/bss_dgram.c: In function 'dgram_recvmmsg':
16:55:14 ../deps/openssl/openssl/crypto/bio/bss_dgram.c:1609:11: warning: implicit declaration of function 'recvmmsg'; did you mean 'recvmsg'? [-Wimplicit-function-declaration]
16:55:14  1609 |     ret = recvmmsg(b->num, mh, num_msg, sysflags, NULL);
16:55:14       |           ^~~~~~~~
16:55:14       |           recvmsg

ref: https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix72-power9/62022/consoleFull

Originally posted by @abmusse in #23751

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions