Integrated patch from Brian Utterback. <hart@ntp.org>
* [Bug 2525] Turn on automake subdir-objects across the project. <hart@ntp.org>
* [Bug 2410] syslog an error message on panic exceeded. <brian.utterback@oracle.com>
+* Disable "embedded NUL in string" messages in libopts, when we can. <stenn@>
* Use https in the AC_INIT URLs in configure.ac. <stenn@ntp.org>
* Implement NTP_FUNC_REALPATH. <stenn@ntp.org>
* Lose a gmake construct in ntpd/Makefile.am. <stenn@ntp.org>
libopts_la_SOURCES = libopts.c
libopts_la_CPPFLAGS = -I$(srcdir)
libopts_la_LDFLAGS = -version-info 42:1:17
+# HMS: we're not currently otherwise using AM_CFLAGS>..
+AM_CFLAGS = $(CC_NOFORMAT)
EXTRA_DIST =
BUILT_SOURCES =
MOSTLYCLEANFILES =
dnl AC_REQUIRE([AC_PROG_CC_C89])
dnl AC_REQUIRE([AC_PROG_CC_C99])
+CC_NOFORMAT=
CFLAGS_NTP=
CPPFLAGS_NTP=
LDADD_NTP=
LDFLAGS_NTP=
+AC_SUBST([CC_NOFORMAT])
AC_SUBST([CFLAGS_NTP])
AC_SUBST([CPPFLAGS_NTP])
AC_SUBST([LDADD_NTP])
case "$GCC" in
yes)
SAVED_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wstrict-overflow"
+ CFLAGS="$SAVED_CFLAGS -Wstrict-overflow"
AC_CACHE_CHECK(
[if $CC can handle -Wstrict-overflow],
[ntp_cv_gcc_Wstrict_overflow],
)
]
)
+ #
+ # libopts specifically builds a string with embedded NULs.
+ # This causes a bunch of distracting warnings due to -Wformat.
+ # Let's see if we can figure out how to disable these.
+ #
+ CFLAGS="$SAVED_CFLAGS -Wno-format"
+ AC_CACHE_CHECK(
+ [if $CC can handle -Wno-format],
+ [ntp_cv_gcc_Wno_format],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [ntp_cv_gcc_Wno_format=yes],
+ [ntp_cv_gcc_Wno_format=no]
+ )
+ ]
+ )
+
+ case "$ntp_cv_gcc_Wno_format" in
+ yes)
+ CC_NOFORMAT="$CC_NOFORMAT -Wno-format"
+ ;;
+ no)
+ ;;
+ esac
+
CFLAGS="$SAVED_CFLAGS"
AS_UNSET([SAVED_CFLAGS])
#