NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
standards/57806: #include <arpa/inet.h> fails to define htonl/htons/ntohl/ntohs under _POSIX_C_SOURCE=200809L
>Number: 57806
>Category: standards
>Synopsis: #include <arpa/inet.h> fails to define htonl/htons/ntohl/ntohs under _POSIX_C_SOURCE=200809L
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: standards-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 01 19:30:00 +0000 2024
>Originator: Taylor R Campbell
>Release: current
>Organization:
The <arpa/inet.h> Foundation
>Environment:
>Description:
POSIX and NetBSD both document htonl/htons/ntohl/ntohs as being provided by #include <arpa/inet.h>, but this doesn't provide them when _POSIX_C_SOURCE is defined to be 200809L.
>How-To-Repeat:
$ cat pr.c
#define _POSIX_C_SOURCE 200809L
#include <arpa/inet.h>
int myntohl(int x) { return ntohl(x); }
$ make pr.o
cc -O2 -c pr.c
pr.c: In function ?myntohl?:
pr.c:3:29: warning: implicit declaration of function ?ntohl?; did you mean ?myntohl?? [-Wimplicit-function-declaration]
int myntohl(int x) { return ntohl(x); }
^~~~~
myntohl
>Fix:
Yes, please!
Home |
Main Index |
Thread Index |
Old Index