From: Dave Hart Date: Sat, 30 Sep 2023 05:35:01 +0000 (+0000) Subject: [Bug 3871] 4.2.8p17 build without hopf6021 refclock enabled fails. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23f3c789394aa62786bfdcddfcbf5bea92f21653;p=thirdparty%2Fntp.git [Bug 3871] 4.2.8p17 build without hopf6021 refclock enabled fails. Reported by Hans Mayer. Moved NONEMPTY_TRANSLATION_UNIT declaration from ntp_types.h to config.h. Use NONEMPTY_COMPILATION_UNIT in more conditionally-compiled files. bk: 6517b385IefDb60vlJX2jwFBn47PTQ --- diff --git a/ChangeLog b/ChangeLog index a27b72b5a..1dc380cef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ --- +* [Bug 3871] 4.2.8p17 build without hopf6021 refclock enabled fails. + Reported by Hans Mayer. Moved NONEMPTY_TRANSLATION_UNIT + declaration from ntp_types.h to config.h. * [Bug 3869] Remove long-gone "calldelay" & "crypto sign" from docs. Reported by PoolMUC@web.de. * [Bug 3859] Use NotifyIpInterfaceChange on Windows ntpd. @@ -39,6 +42,7 @@ * Provide ntpd thread names to debugger on Windows. * Remove dead code libntp/numtohost.c and its unit tests. * Remove class A, B, C IPv4 distinctions in netof(). +* Use NONEMPTY_COMPILATION_UNIT in more conditionally-compiled files. --- (4.2.8p17) 2023/06/06 Released by Harlan Stenn diff --git a/configure.ac b/configure.ac index 3f53382de..5d2138f6f 100644 --- a/configure.ac +++ b/configure.ac @@ -4432,6 +4432,18 @@ AC_DEFINE_UNQUOTED([DYNAMIC_INTERLEAVE], [$ntp_dynamic_interleave], [support dynamic interleave?]) AC_MSG_RESULT([$ntp_ok]) +AH_BOTTOM([ + /* + * Macro to use in otherwise-empty source files to comply with ANSI C + * requirement that each translation unit (source file) contain some + * declaration. This has commonly been done by declaring an unused + * global variable of type int or char. An extern reference to abs() + * serves the same purpose without bloat. We once used exit() but + * that can produce warnings on systems that declare exit() noreturn. + */ + #define NONEMPTY_TRANSLATION_UNIT extern int abs(int); +]) + NTP_UNITYBUILD NTP_PROBLEM_TESTS diff --git a/include/ntp_types.h b/include/ntp_types.h index c3cf2c196..6553f01b8 100644 --- a/include/ntp_types.h +++ b/include/ntp_types.h @@ -254,16 +254,6 @@ aligned_ptr( return base + ALIGN_UNITS((minsize < 1) ? 1 : minsize); } -/* - * Macro to use in otherwise-empty source files to comply with ANSI C - * requirement that each translation unit (source file) contain some - * declaration. This has commonly been done by declaring an unused - * global variable of type int or char. An extern reference to abs() - * serves the same purpose without bloat. We once used exit() but - * that can produce warnings on systems that declare exit() noreturn. - */ -#define NONEMPTY_TRANSLATION_UNIT extern int abs(int); - /* * On Unix struct sock_timeval is equivalent to struct timeval. * On Windows built with 64-bit time_t, sock_timeval.tv_sec is a long diff --git a/libntp/adjtime.c b/libntp/adjtime.c index b536cc555..57accd686 100644 --- a/libntp/adjtime.c +++ b/libntp/adjtime.c @@ -381,6 +381,6 @@ adjtime (struct timeval *delta, struct timeval *olddelta) return 0; } # else /* no special adjtime() needed */ -int adjtime_bs; +NONEMPTY_TRANSLATION_UNIT # endif #endif diff --git a/libntp/audio.c b/libntp/audio.c index f404cc078..2cbae7a30 100644 --- a/libntp/audio.c +++ b/libntp/audio.c @@ -517,5 +517,5 @@ audio_show(void) #endif /* not PCM_STYLE_SOUND */ } #else -int audio_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* HAVE_{SYS_AUDIOIO,SUN_AUDIOIO,MACHINE_SOUNDCARD,SYS_SOUNDCARD}_H */ diff --git a/libntp/bsd_strerror.c b/libntp/bsd_strerror.c index 5ace9aa48..23888a2d1 100644 --- a/libntp/bsd_strerror.c +++ b/libntp/bsd_strerror.c @@ -45,5 +45,5 @@ strerror( return ebuf; } #else -int strerror_bs; +NONEMPTY_TRANSLATION_UNIT #endif diff --git a/libntp/snprintf.c b/libntp/snprintf.c index f4685e1ad..52ec17a04 100644 --- a/libntp/snprintf.c +++ b/libntp/snprintf.c @@ -1587,7 +1587,7 @@ rpl_asprintf(va_alist) va_dcl } #endif /* HW_WANT_RPL_ASPRINTF */ #else /* Dummy declaration to avoid empty translation unit warnings. */ -int main(void); +NONEMPTY_TRANSLATION_UNIT #endif /* HW_WANT_RPL_SNPRINTF || HW_WANT_RPL_VSNPRINTF || HW_WANT_RPL_ASPRINTF || [...] */ #if TEST_SNPRINTF diff --git a/libparse/clk_computime.c b/libparse/clk_computime.c index 7273ac762..10ec9a7c1 100644 --- a/libparse/clk_computime.c +++ b/libparse/clk_computime.c @@ -182,7 +182,7 @@ inp_computime( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_COMPUTIME) */ -int clk_computime_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_COMPUTIME) */ /* diff --git a/libparse/clk_dcf7000.c b/libparse/clk_dcf7000.c index 0621cd564..4aeb4c39b 100644 --- a/libparse/clk_dcf7000.c +++ b/libparse/clk_dcf7000.c @@ -176,7 +176,7 @@ inp_dcf7000( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_DCF7000) */ -int clk_dcf7000_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_DCF7000) */ /* diff --git a/libparse/clk_meinberg.c b/libparse/clk_meinberg.c index e4ebf0acc..1aa839bfd 100644 --- a/libparse/clk_meinberg.c +++ b/libparse/clk_meinberg.c @@ -733,7 +733,7 @@ gps_input( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_MEINBERG) */ -int clk_meinberg_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_MEINBERG) */ /* diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c index 3fa74997c..9b6eeafb1 100644 --- a/libparse/clk_rawdcf.c +++ b/libparse/clk_rawdcf.c @@ -742,7 +742,7 @@ inp_rawdcf( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RAWDCF) */ -int clk_rawdcf_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RAWDCF) */ /* diff --git a/libparse/clk_rcc8000.c b/libparse/clk_rcc8000.c index 11d52acc5..e9bb115da 100644 --- a/libparse/clk_rcc8000.c +++ b/libparse/clk_rcc8000.c @@ -163,7 +163,7 @@ inp_rcc8000( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RCC8000) */ -int clk_rcc8000_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RCC8000) */ /* diff --git a/libparse/clk_schmid.c b/libparse/clk_schmid.c index d85b1a5da..5dd52047a 100644 --- a/libparse/clk_schmid.c +++ b/libparse/clk_schmid.c @@ -222,7 +222,7 @@ inp_schmid( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SCHMID) */ -int clk_schmid_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SCHMID) */ /* diff --git a/libparse/clk_sel240x.c b/libparse/clk_sel240x.c index b1390b4ce..f27b66249 100644 --- a/libparse/clk_sel240x.c +++ b/libparse/clk_sel240x.c @@ -168,5 +168,5 @@ cvt_sel240x( unsigned char *buffer, } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SEL240X) */ -int clk_sel240x_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SEL240X) */ diff --git a/libparse/clk_trimtaip.c b/libparse/clk_trimtaip.c index a60d01ec1..ce930952f 100644 --- a/libparse/clk_trimtaip.c +++ b/libparse/clk_trimtaip.c @@ -181,7 +181,7 @@ inp_trimtaip( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTAIP) */ -int clk_trimtaip_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTAIP) */ /* diff --git a/libparse/clk_trimtsip.c b/libparse/clk_trimtsip.c index 8cf566065..5af69d349 100644 --- a/libparse/clk_trimtsip.c +++ b/libparse/clk_trimtsip.c @@ -388,7 +388,7 @@ cvt_trimtsip( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTSIP && !PARSESTREAM) */ -int clk_trimtsip_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTSIP && !PARSESTREAM) */ /* diff --git a/libparse/clk_varitext.c b/libparse/clk_varitext.c index 0d830354d..a4c6d31b7 100644 --- a/libparse/clk_varitext.c +++ b/libparse/clk_varitext.c @@ -252,7 +252,7 @@ inp_varitext( } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_VARITEXT) */ -int clk_varitext_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_VARITEXT) */ /* diff --git a/libparse/parse.c b/libparse/parse.c index 69395ac4a..56f2c3702 100644 --- a/libparse/parse.c +++ b/libparse/parse.c @@ -875,7 +875,7 @@ parse_setcs( } #else /* not (REFCLOCK && CLOCK_PARSE) */ -int parse_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE) */ /* diff --git a/libparse/parse_conf.c b/libparse/parse_conf.c index 37871c9de..ad7a47aa9 100644 --- a/libparse/parse_conf.c +++ b/libparse/parse_conf.c @@ -148,7 +148,7 @@ clockformat_t *clockformats[] = unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1; #else /* not (REFCLOCK && CLOCK_PARSE) */ -int parse_conf_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_PARSE) */ /* diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 4a4207683..f9c71ff31 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -4168,5 +4168,5 @@ exten_payload_size( return (u_int)data_size; } # else /* !AUTOKEY follows */ -int ntp_crypto_bs_pubkey; +NONEMPTY_TRANSLATION_UNIT # endif /* !AUTOKEY */ diff --git a/ntpd/refclock_acts.c b/ntpd/refclock_acts.c index 944ac764c..709427d34 100644 --- a/ntpd/refclock_acts.c +++ b/ntpd/refclock_acts.c @@ -897,5 +897,5 @@ acts_timecode( pp->lastref = pp->lastrec; } #else -int refclock_acts_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_arbiter.c b/ntpd/refclock_arbiter.c index 7de613fa7..b92e72361 100644 --- a/ntpd/refclock_arbiter.c +++ b/ntpd/refclock_arbiter.c @@ -473,5 +473,5 @@ arb_poll( } #else -int refclock_arbiter_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_as2201.c b/ntpd/refclock_as2201.c index d71284173..bb485551b 100644 --- a/ntpd/refclock_as2201.c +++ b/ntpd/refclock_as2201.c @@ -385,5 +385,5 @@ as2201_poll( } #else -int refclock_as2201_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_atom.c b/ntpd/refclock_atom.c index b3c0d6b46..6e01352db 100644 --- a/ntpd/refclock_atom.c +++ b/ntpd/refclock_atom.c @@ -235,5 +235,5 @@ atom_poll( refclock_receive(peer); } #else -int refclock_atom_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_bancomm.c b/ntpd/refclock_bancomm.c index 577ad2772..d0d855d57 100644 --- a/ntpd/refclock_bancomm.c +++ b/ntpd/refclock_bancomm.c @@ -617,5 +617,5 @@ stfp_time2tvme(struct vmedate *time_vme, struct stfp_time *stfp) return; } #else -int refclock_bancomm_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_chronolog.c b/ntpd/refclock_chronolog.c index 1499ee4c8..4a8a4aa86 100644 --- a/ntpd/refclock_chronolog.c +++ b/ntpd/refclock_chronolog.c @@ -339,5 +339,5 @@ chronolog_poll( } #else -int refclock_chronolog_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_conf.c b/ntpd/refclock_conf.c index 30cc63206..ddabf932e 100644 --- a/ntpd/refclock_conf.c +++ b/ntpd/refclock_conf.c @@ -322,5 +322,5 @@ struct refclock * const refclock_conf[] = { u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *); #else -int refclock_conf_bs; +NONEMPTY_TRANSLATION_UNIT #endif diff --git a/ntpd/refclock_dumbclock.c b/ntpd/refclock_dumbclock.c index 3563847da..37aaf28fa 100644 --- a/ntpd/refclock_dumbclock.c +++ b/ntpd/refclock_dumbclock.c @@ -373,5 +373,5 @@ dumbclock_poll( #endif #else -int refclock_dumbclock_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* defined(REFCLOCK) && defined(CLOCK_DUMBCLOCK) */ diff --git a/ntpd/refclock_fg.c b/ntpd/refclock_fg.c index abcf43f9c..9ded8c7e7 100644 --- a/ntpd/refclock_fg.c +++ b/ntpd/refclock_fg.c @@ -331,5 +331,5 @@ fg_receive( #else -int refclock_fg_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_gpsvme.c b/ntpd/refclock_gpsvme.c index 66ccc9a3e..3920b7a3c 100644 --- a/ntpd/refclock_gpsvme.c +++ b/ntpd/refclock_gpsvme.c @@ -249,5 +249,5 @@ check_leap_sec(struct refclockproc *pp, int unit) } #else -int refclock_gpsvme_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_heath.c b/ntpd/refclock_heath.c index e34fa6b93..2d9aa45a5 100644 --- a/ntpd/refclock_heath.c +++ b/ntpd/refclock_heath.c @@ -446,5 +446,5 @@ heath_poll( } #else -int refclock_heath_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_hopfpci.c b/ntpd/refclock_hopfpci.c index 95bcab983..5b63e593f 100644 --- a/ntpd/refclock_hopfpci.c +++ b/ntpd/refclock_hopfpci.c @@ -254,5 +254,5 @@ hopfpci_poll( } #else -int refclock_hopfpci_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_hopfser.c b/ntpd/refclock_hopfser.c index e8e5ecefd..6cc39c90b 100644 --- a/ntpd/refclock_hopfser.c +++ b/ntpd/refclock_hopfser.c @@ -362,5 +362,5 @@ hopfserial_poll ( } #else -int refclock_hopfser_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_hpgps.c b/ntpd/refclock_hpgps.c index fb7085a79..e9a871721 100644 --- a/ntpd/refclock_hpgps.c +++ b/ntpd/refclock_hpgps.c @@ -622,5 +622,5 @@ hpgps_poll( } #else -int refclock_hpgps_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_irig.c b/ntpd/refclock_irig.c index abc94f62e..29cf5d6a7 100644 --- a/ntpd/refclock_irig.c +++ b/ntpd/refclock_irig.c @@ -1039,5 +1039,5 @@ irig_gain( #else -int refclock_irig_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_jjy.c b/ntpd/refclock_jjy.c index c4e1697bf..84956eb1d 100644 --- a/ntpd/refclock_jjy.c +++ b/ntpd/refclock_jjy.c @@ -4525,5 +4525,5 @@ printableString ( char *sOutput, int iOutputLen, const char *sInput, int iInputL /**************************************************************************************************/ #else -int refclock_jjy_bs ; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_jupiter.c b/ntpd/refclock_jupiter.c index 7db0198ec..4deac7401 100644 --- a/ntpd/refclock_jupiter.c +++ b/ntpd/refclock_jupiter.c @@ -1028,5 +1028,5 @@ jupiter_recv( } #else /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */ -int refclock_jupiter_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */ diff --git a/ntpd/refclock_local.c b/ntpd/refclock_local.c index 8c0f74f62..62de1a98e 100644 --- a/ntpd/refclock_local.c +++ b/ntpd/refclock_local.c @@ -213,5 +213,5 @@ local_poll( refclock_receive(peer); } #else -int refclock_local_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_mx4200.c b/ntpd/refclock_mx4200.c index 11c17d069..0de856ee1 100644 --- a/ntpd/refclock_mx4200.c +++ b/ntpd/refclock_mx4200.c @@ -1635,5 +1635,5 @@ mx4200_send(peer, fmt, va_alist) } #else -int refclock_mx4200_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_neoclock4x.c b/ntpd/refclock_neoclock4x.c index a54381678..a8c0a3363 100644 --- a/ntpd/refclock_neoclock4x.c +++ b/ntpd/refclock_neoclock4x.c @@ -1057,7 +1057,7 @@ neol_check_firmware(int unit, #endif #else -int refclock_neoclock4x_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ /* diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c index d41d54023..512e64b64 100644 --- a/ntpd/refclock_oncore.c +++ b/ntpd/refclock_oncore.c @@ -4136,5 +4136,5 @@ oncore_log_f( } #else -int refclock_oncore_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK && CLOCK_ONCORE */ diff --git a/ntpd/refclock_palisade.c b/ntpd/refclock_palisade.c index a9fe26895..3a61d6012 100644 --- a/ntpd/refclock_palisade.c +++ b/ntpd/refclock_palisade.c @@ -1567,5 +1567,5 @@ getsingle( } #else /* REFCLOCK && CLOCK_PALISADE*/ -int refclock_palisade_c_notempty; +NONEMPTY_TRANSLATION_UNIT #endif diff --git a/ntpd/refclock_pcf.c b/ntpd/refclock_pcf.c index 45b3475c0..4e92370ec 100644 --- a/ntpd/refclock_pcf.c +++ b/ntpd/refclock_pcf.c @@ -223,5 +223,5 @@ pcf_poll( refclock_receive(peer); } #else -int refclock_pcf_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_pst.c b/ntpd/refclock_pst.c index 1d3e1ffcf..bd0f15938 100644 --- a/ntpd/refclock_pst.c +++ b/ntpd/refclock_pst.c @@ -314,5 +314,5 @@ pst_poll( } #else -int refclock_pst_int; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_ripencc.c b/ntpd/refclock_ripencc.c index 789029f8a..a7339e3d4 100644 --- a/ntpd/refclock_ripencc.c +++ b/ntpd/refclock_ripencc.c @@ -5250,6 +5250,6 @@ TranslateTSIPReportToText( #endif /* TRIMBLE_OUTPUT_FUNC */ #else /* defined(REFCLOCK) && defined(CLOCK_RIPENCC) */ -int refclock_ripencc_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* defined(REFCLOCK) && defined(CLOCK_RIPENCC) */ diff --git a/ntpd/refclock_tpro.c b/ntpd/refclock_tpro.c index ac511bb4b..9adcb5c6c 100644 --- a/ntpd/refclock_tpro.c +++ b/ntpd/refclock_tpro.c @@ -204,5 +204,5 @@ tpro_poll( } #else -int refclock_tpro_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_true.c b/ntpd/refclock_true.c index 78e6adb9a..e41cd1351 100644 --- a/ntpd/refclock_true.c +++ b/ntpd/refclock_true.c @@ -977,5 +977,5 @@ true_sample720(void) #endif #else -int refclock_true_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_tsyncpci.c b/ntpd/refclock_tsyncpci.c index e14a3fd12..49097ea72 100644 --- a/ntpd/refclock_tsyncpci.c +++ b/ntpd/refclock_tsyncpci.c @@ -908,5 +908,5 @@ void DoyTimeFromSecTime(DoyTimeObj* pDt, SecTimeObj* pSt) } // End DoyTimeFromSecTime #else -int refclock_tsyncpci_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_tt560.c b/ntpd/refclock_tt560.c index 171ba5c8c..89bca1361 100644 --- a/ntpd/refclock_tt560.c +++ b/ntpd/refclock_tt560.c @@ -266,5 +266,5 @@ byte_swap(unsigned int input_num) } #else -int refclock_tt560_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_ulink.c b/ntpd/refclock_ulink.c index 60147adba..c09638c21 100644 --- a/ntpd/refclock_ulink.c +++ b/ntpd/refclock_ulink.c @@ -564,5 +564,5 @@ ulink_poll( } #else -int refclock_ulink_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_wwv.c b/ntpd/refclock_wwv.c index 2736cfa32..f4098ae81 100644 --- a/ntpd/refclock_wwv.c +++ b/ntpd/refclock_wwv.c @@ -2707,5 +2707,5 @@ wwv_gain( #else -int refclock_wwv_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_wwvb.c b/ntpd/refclock_wwvb.c index 6aafc26f1..3720cdf80 100644 --- a/ntpd/refclock_wwvb.c +++ b/ntpd/refclock_wwvb.c @@ -599,5 +599,5 @@ wwvb_control( #endif /* HAVE_PPSAPI */ #else -int refclock_wwvb_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpd/refclock_zyfer.c b/ntpd/refclock_zyfer.c index f77604868..0ec566d5a 100644 --- a/ntpd/refclock_zyfer.c +++ b/ntpd/refclock_zyfer.c @@ -344,5 +344,5 @@ zyfer_poll( } #else -int refclock_zyfer_bs; +NONEMPTY_TRANSLATION_UNIT #endif /* REFCLOCK */ diff --git a/ntpsnmpd/netsnmp_daemonize.c b/ntpsnmpd/netsnmp_daemonize.c index 44fad1ad3..f806266c6 100644 --- a/ntpsnmpd/netsnmp_daemonize.c +++ b/ntpsnmpd/netsnmp_daemonize.c @@ -267,5 +267,5 @@ netsnmp_daemonize(int quit_immediately, int stderr_log) } #else /* !NEED_NETSNMP_DAEMONIZE */ -int netsnp_daemonize_bs; +NONEMPTY_TRANSLATION_UNIT #endif diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h index 2f2b0d656..0b53c53d4 100644 --- a/ports/winnt/include/config.h +++ b/ports/winnt/include/config.h @@ -562,6 +562,16 @@ typedef unsigned long uintptr_t; # define DYNAMIC_INTERLEAVE 0 #endif +/* + * Macro to use in otherwise-empty source files to comply with ANSI C + * requirement that each translation unit (source file) contain some + * declaration. This has commonly been done by declaring an unused + * global variable of type int or char. An extern reference to abs() + * serves the same purpose without bloat. We once used exit() but + * that can produce warnings on systems that declare exit() noreturn. + */ +#define NONEMPTY_TRANSLATION_UNIT extern int abs(int); + /* * Below this line are includes which must happen after the bulk of * config.h is processed. If you need to add another #include to this diff --git a/ports/winnt/vs2015/libntp/libntp.vcxproj b/ports/winnt/vs2015/libntp/libntp.vcxproj index 1b87cea1d..c028b2b18 100644 --- a/ports/winnt/vs2015/libntp/libntp.vcxproj +++ b/ports/winnt/vs2015/libntp/libntp.vcxproj @@ -126,6 +126,7 @@ + diff --git a/ports/winnt/vs2015/libntp/libntp.vcxproj.filters b/ports/winnt/vs2015/libntp/libntp.vcxproj.filters index 23fff905d..d2ee93b1d 100644 --- a/ports/winnt/vs2015/libntp/libntp.vcxproj.filters +++ b/ports/winnt/vs2015/libntp/libntp.vcxproj.filters @@ -344,6 +344,9 @@ libisc Source Files + + Source Files + diff --git a/ports/winnt/vs2015/ntpd/ntpd.vcxproj b/ports/winnt/vs2015/ntpd/ntpd.vcxproj index a177aa661..e1efd3d9d 100644 --- a/ports/winnt/vs2015/ntpd/ntpd.vcxproj +++ b/ports/winnt/vs2015/ntpd/ntpd.vcxproj @@ -121,6 +121,7 @@ + @@ -317,4 +318,4 @@ - + \ No newline at end of file diff --git a/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters b/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters index 3ff368308..b4c45ca07 100644 --- a/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters +++ b/ports/winnt/vs2015/ntpd/ntpd.vcxproj.filters @@ -309,6 +309,9 @@ Reference Clock + + Parse Lib + @@ -552,18 +555,13 @@ - - Generated Files - - - Resource Files - Header Files - + + \ No newline at end of file