[Git][NTPsec/ntpsec][master] Make sure to include config.h first of all project-local headers

Hal Murray gitlab at mg.gitlab.com
Mon Jan 28 03:18:10 UTC 2019


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
b09678cf by Matt Selsky at 2019-01-28T02:46:07Z
Make sure to include config.h first of all project-local headers

This way later macros are properly conditionalized.  For example, without this,
we get the following error on macOS because we our the included implementation
of strlcat instead of the macOS version:

In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:142:15: error: expected parameter declarator
extern  size_t  strlcpy(char *dst, const char *src, size_t siz);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
                                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
                               ^
In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:142:15: error: expected ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
                                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
                               ^
../../include/ntp_stdlib.h:142:15: note: to match this '('
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
                                                    ^
In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:142:15: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern  size_t  strlcpy(char *dst, const char *src, size_t siz);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:108:47: note: expanded from macro 'strlcpy'
                __builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
                              ^
In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:142:15: error: conflicting types for '__builtin___strlcpy_chk'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/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:142:15: note: '__builtin___strlcpy_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/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 ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:152:15: error: expected parameter declarator
extern  size_t  strlcat(char *dst, const char *src, size_t siz);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
                                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
                               ^
In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:152:15: error: expected ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
                                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
                               ^
../../include/ntp_stdlib.h:152:15: note: to match this '('
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
                                                    ^
In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:152:15: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern  size_t  strlcat(char *dst, const char *src, size_t siz);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:115:47: note: expanded from macro 'strlcat'
                __builtin___strlcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
                              ^
In file included from ../../ntpd/nts.c:15:
In file included from ../../include/ntp.h:15:
../../include/ntp_stdlib.h:152:15: error: conflicting types for '__builtin___strlcat_chk'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/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:152:15: note: '__builtin___strlcat_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/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:

- ntpd/nts.c


Changes:

=====================================
ntpd/nts.c
=====================================
@@ -11,6 +11,7 @@
  * The exception is client configuration, for which various bits have
  * to be set by the config parser.
  */
+#include "config.h"
 #include "ntp_types.h"
 #include "ntp.h"
 #include "nts.h"



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

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/b09678cf7bc590ce4b442a7e2440d918b30518eb
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/20190128/51caeab1/attachment.html>


More information about the vc mailing list