flightaware / scotty

A Tcl extension for building network management (SNMP, ICMP, UDP, DNS) applications
33 stars 17 forks source link

Build of tnm fails with -Werror=implicit-function-declaration #13

Open cooljeanius opened 2 years ago

cooljeanius commented 2 years ago

Apple has been shipping its versions of clang with -Werror=implicit-function-declaration enabled by default for awhile now, which leads to the following build failure for tnm:

gcc -DHAVE_CONFIG_H  -I. -Igeneric -Isnmp -I"/Library/Frameworks/Tcl.framework/Headers"    -g -O2 -pipe  -Os -DNDEBUG -Wall -fno-common   -c `echo mount_clnt.c` -o mount_clnt.o
mount_clnt.c:18:2: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Werror,-Wimplicit-function-declaration]
        memset((char *)&clnt_res, 0, sizeof(clnt_res));
        ^

Fixing it should be easy; just add a line like

#include <string.h>

to either mount_clnt.c or mount.h. Originally reported to MacPorts here: https://trac.macports.org/ticket/63332

cooljeanius commented 1 year ago

I tried working around this in my fork in cooljeanius/scotty#2 and cooljeanius/scotty@ec8df63, but it looks like it's going to require learning how rpcgen works to actually fix this properly...