[Git][NTPsec/ntpsec][master] Fix compiler warnings on Solaris in ntpfrob/main.c

Matt Selsky gitlab at mg.gitlab.com
Sat Dec 9 05:57:59 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
c41fc7ac by Matt Selsky at 2017-12-09T00:39:42-05:00
Fix compiler warnings on Solaris in ntpfrob/main.c

../../ntpfrob/main.c: In function 'main':
../../ntpfrob/main.c:40:2: warning: implicit declaration of function 'getopt' [-Wimplicit-function-declaration]
  while ((ch = getopt(argc, argv, "a:Ab:cejp:rh?")) != EOF) {
  ^

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.

- - - - -


1 changed file:

- ntpfrob/main.c


Changes:

=====================================
ntpfrob/main.c
=====================================
--- a/ntpfrob/main.c
+++ b/ntpfrob/main.c
@@ -2,12 +2,13 @@
  * SPDX-License-Identifier: BSD-2-Clause
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <getopt.h>
 #include <stdbool.h>
 
-#include "config.h"
 #include "ntpfrob.h"
 
 static void usage(void);



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/c41fc7ac67e26cdf4fc82ea3da5af9277dd30bec
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/20171209/9ff292f1/attachment.html>


More information about the vc mailing list