Skip to content

ntptime: fix jfmt5/ofmt5 jfmt6/ofmt6 related compile failure

Use same define guard for definiton as for usage ('HAVE_STRUCT_NTPTIMEVAL_TAI' instead of 'NTP_API && NTP_API > 3').

Fixes:

../../ntptime/ntptime.c: In function ‘main’: ../../ntptime/ntptime.c:349:17: error: ‘jfmt5’ undeclared (first use in this function); did you mean ‘jfmt6’? 349 | printf(json ? jfmt5 : ofmt5, (long)ntv.tai); | ^~~~~ | jfmt6 ../../ntptime/ntptime.c:349:17: note: each undeclared identifier is reported only once for each function it appears in ../../ntptime/ntptime.c:349:25: error: ‘ofmt5’ undeclared (first use in this function); did you mean ‘ofmt6’? 349 | printf(json ? jfmt5 : ofmt5, (long)ntv.tai); | ^~~~~ | ofmt6 ../../ntptime/ntptime.c:321:15: warning: unused variable ‘jfmt6’ [-Wunused-variable] 321 | const char *jfmt6 = ""; | ^~~~~ ../../ntptime/ntptime.c:311:15: warning: unused variable ‘ofmt6’ [-Wunused-variable] 311 | const char *ofmt6 = "\n"; | ^~~~~

Signed-off-by: Peter Seiderer ps.report@gmx.net

Merge request reports