Opened 4 weeks ago

#62219 assigned defect

netperf @2.7.0: error: implicit declaration of function 'read' is invalid in C99

Reported by: ryandesign (Ryan Schmidt) Owned by: grimreaper (Eitan Adler)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: catalina bigsur Cc:
Port: netperf

Description

netperf does not build with Xcode 12 or later due to the well-known implicit declaration of function problem.

https://build.macports.org/builders/ports-11_arm64-builder/builds/10926/steps/install-port/logs/stdio

net_uuid.c:158:5: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    read(fd, seed, 16);
    ^
net_uuid.c:158:5: note: did you mean 'fread'?
/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include/stdio.h:158:9: note: 'fread' declared here
size_t   fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
         ^
net_uuid.c:159:5: error: implicit declaration of function 'close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    close(fd);
    ^

The fix is to patch the code to include the system headers that define these functions. Maybe upstream already fixed it; if so, we use their patch. If not, we report it to them.

Change History (0)

Note: See TracTickets for help on using tickets.