[Git][NTPsec/ntpsec][master] Make sure to include config.h in tests/ntpd/nts.c

Hal Murray gitlab at mg.gitlab.com
Thu Mar 14 06:34:47 UTC 2019



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
b525ad6a by Matt Selsky at 2019-03-14T04:48:51Z
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.

- - - - -


1 changed file:

- tests/ntpd/nts.c


Changes:

=====================================
tests/ntpd/nts.c
=====================================
@@ -1,3 +1,4 @@
+#include "config.h"
 #include "ntpd.h"
 #include "nts.h"
 #include "nts2.h"



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/b525ad6ad1172ac462aa7a8e69fa3a2b78c9a044

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/b525ad6ad1172ac462aa7a8e69fa3a2b78c9a044
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190314/cb7f7e86/attachment.html>


More information about the vc mailing list