[Git][NTPsec/ntpsec][master] FALLTHRU: llvm 8.0.0 does not understand __attribute__ ((fallthrough))

Gary E. Miller gitlab at mg.gitlab.com
Wed May 10 22:31:11 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
f8f4c7a0 by Gary E. Miller at 2017-05-10T15:29:31-07:00
FALLTHRU: llvm 8.0.0 does not understand __attribute__ ((fallthrough))

- - - - -


2 changed files:

- include/ntpd.h
- ntpd/ntp_loopfilter.c


Changes:

=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -46,6 +46,18 @@
 # define DPRINTF(lvl, arg)	do {} while (0)
 #endif
 
+/*
+ * macro to silence -Wimplicit-fallthrough
+ * of course gcc and clang do it differently
+ */
+#ifdef __clang__
+# define FALLTHRU
+#elif defined __GNUC__
+# define FALLTHRU [[gcc::fallthrough]]
+#else
+# define FALLTHRU
+#endif
+
 
 /* ntp_config.c */
 #define	TAI_1972	10	/* initial TAI offset (s) */


=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -608,7 +608,7 @@ local_clock(
 				return (0);
 
 			clock_frequency = direct_freq(fp_offset);
-			__attribute__ ((fallthrough));
+			FALLTHRU;
 			/* FALLTHRU to EVNT_SPIK */
 
 		/*



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f8f4c7a081e248b49ea4983e81d5e2f0560726e3
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/20170510/e7ee178f/attachment.html>


More information about the vc mailing list