Make sure to include config.h in tests/ntpd/nts.c
Otherwise header files are included without our local symbols that control which other symbols are exposed
In this case, the result of trying to build on macOS was:
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:135:15: error: expected parameter declarator
extern size_t strlcpy(char *dst, const char *src, size_t siz);
^
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:135:15: error: expected ')'
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
^
../../include/ntp_stdlib.h:135:15: note: to match this '('
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:135:15: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern size_t strlcpy(char *dst, const char *src, size_t siz);
^
/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:135:15: error: conflicting types for '__builtin___strlcpy_chk'
/usr/include/secure/_string.h:108:3: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
../../include/ntp_stdlib.h:135:15: note: '__builtin___strlcpy_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)'
/usr/include/secure/_string.h:108:3: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:145:15: error: expected parameter declarator
extern size_t strlcat(char *dst, const char *src, size_t siz);
^
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
__builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:145:15: error: expected ')'
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
__builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
^
../../include/ntp_stdlib.h:145:15: note: to match this '('
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
__builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:145:15: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern size_t strlcat(char *dst, const char *src, size_t siz);
^
/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
__builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
^
In file included from ../../tests/ntpd/nts.c:1:
In file included from ../../include/ntpd.h:13:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:145:15: error: conflicting types for '__builtin___strlcat_chk'
/usr/include/secure/_string.h:115:3: note: expanded from macro 'strlcat'
__builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
../../include/ntp_stdlib.h:145:15: note: '__builtin___strlcat_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)'
/usr/include/secure/_string.h:115:3: note: expanded from macro 'strlcat'
__builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
2 warnings and 6 errors generated.
Loading
Please register or sign in to comment