+2010-04-11 Bruno Haible <bruno@clisp.org>
+
+ Stricter declaration checking in testdirs.
+ * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
+ If for_tests is true, augment AM_CPPFLAGS to define
+ GNULIB_STRICT_CHECKING.
+ * build-aux/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_CXX): When
+ GNULIB_STRICT_CHECKING is defined, verify that the function is
+ declared.
+
2010-04-11 Paolo Bonzini <bonzini@gnu.org>
Bruno Haible <bruno@clisp.org>
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \
extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
-
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
# else /* Unsupported. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes \
__attribute__ ((__warning__ (msg)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes
# else /* Unsupported. */
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
done
if test -z "$makefile_name"; then
echo
- echo "AM_CPPFLAGS ="
+ if $for_test; then
+ echo "AM_CPPFLAGS = -DGNULIB_STRICT_CHECKING=1"
+ else
+ echo "AM_CPPFLAGS ="
+ fi
echo "AM_CFLAGS ="
fi
echo
done
echo
echo "AM_CPPFLAGS = \\"
+ if $for_test; then
+ echo " -DGNULIB_STRICT_CHECKING=1 \\"
+ fi
if test -n "${witness_macro}"; then
echo " -D@${witness_macro}@=1 \\"
fi