[Git][NTPsec/ntpsec][master] Fix warnings on Solaris about clock_settime() being implicitly defined

Matt Selsky gitlab at mg.gitlab.com
Fri Dec 8 14:57:50 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
723cdbbe by Matt Selsky at 2017-12-08T09:30:12-05:00
Fix warnings on Solaris about clock_settime() being implicitly defined

../../libntp/clockwork.c:83:2: warning: implicit declaration of function 'clock_settime' [-Wimplicit-function-declaration]
../../ntpfrob/bumpclock.c:26:5: warning: implicit declaration of function 'clock_settime' [-Wimplicit-function-declaration]
../../ntpfrob/bumpclock.c:41:5: warning: implicit declaration of function 'clock_settime' [-Wimplicit-function-declaration]

Commit "Reduce clutter from ./waf -v" caused definitions like __EXTENSIONS__
and _POSIX_C_SOURCE to now only be defined in config.h, instead of being in the
command line passed to the compiler.

Therefore we must include config.h before including system headers to get the
correct feature macros to be set so that we get POSIX versions of functions and
symbols.

Fixes Gitlab issue #422

- - - - -


2 changed files:

- libntp/clockwork.c
- ntpfrob/bumpclock.c


Changes:

=====================================
libntp/clockwork.c
=====================================
--- a/libntp/clockwork.c
+++ b/libntp/clockwork.c
@@ -2,12 +2,11 @@
  * clockwork.c - the interface to the hardare clock
  */
 
-#include <unistd.h>
-
 #include "config.h"
 
-# include <sys/time.h>	/* prerequisite on NetBSD */
-# include <sys/timex.h>
+#include <unistd.h>
+#include <sys/time.h>	/* prerequisite on NetBSD */
+#include <sys/timex.h>
 
 #include "ntp.h"
 #include "ntp_machine.h"


=====================================
ntpfrob/bumpclock.c
=====================================
--- a/ntpfrob/bumpclock.c
+++ b/ntpfrob/bumpclock.c
@@ -4,13 +4,14 @@
  * Arg is microseconds.
  */
 
+#include "config.h"
+
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
-#include "config.h"
 #include "ntpfrob.h"
 
 #define NS_PER_S	1000000000



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/723cdbbe032959be912234f17593758bc19b0a8d
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/20171208/84a636c6/attachment.html>


More information about the vc mailing list