Skip to contentSkip to conversation

getport: fix missing stddef.h inclusion

PATCH In review Jaipaul Cheernam 2 participants 2 messages Aug 6 – Aug 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getport: fix missing stddef.h inclusion

getport.c uses offsetof() but does not include <stddef.h>. On glibc this works because offsetof is pulled in transitively, but on musl it is not available without the explicit include, causing:

getport.c:459:41: error: implicit declaration of function 'offsetof'

---
 support/nfs/getport.c | 1 +
 1 file changed, 1 insertion(+)
support/nfs/getport.c +1 -0
index 608e185..6bd2f71 100644
@@ -27,6 +27,7 @@
 #endif
 
 #include <sys/types.h>
+#include <stddef.h>
 #include <sys/time.h>
 #include <unistd.h>
 #include <fcntl.h>
#1 lore raw
Quoted 7 lines · Jaipaul Cheernam

getport.c uses offsetof() but does not include <stddef.h>. On glibc this works because offsetof is pulled in transitively, but on musl it is not available without the explicit include, causing:

getport.c:459:41: error: implicit declaration of function 'offsetof'

Committed... (tag: nfs-utils-2-9-3-rc1)

steved.> ---

Quoted 16 lines
  support/nfs/getport.c | 1 +
  1 file changed, 1 insertion(+)
support/nfs/getport.c +1 -0
index 608e185..6bd2f71 100644
@@ -27,6 +27,7 @@
  #endif
 
  #include <sys/types.h>
+#include <stddef.h>
  #include <sys/time.h>
  #include <unistd.h>
  #include <fcntl.h>