+2023-05-28 Bruno Haible <bruno@clisp.org>
+
+ error: Avoid -Wint-in-bool-context warning.
+ Reported by Pádraig Brady in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00178.html>.
+ * lib/error.in.h (error, error_at_line): Use 'status != 0', since status
+ is expected to be an int, not a bool value.
+
2023-05-27 Bruno Haible <bruno@clisp.org>
error: Support the compiler's control flow analysis better.
# ifndef _GL_NO_INLINE_ERROR
# undef error
# define error(status, ...) \
- ((rpl_error)(0, __VA_ARGS__), (status) ? exit (status) : (void)0)
+ ((rpl_error)(0, __VA_ARGS__), (status) != 0 ? exit (status) : (void)0)
# endif
#else
# if ! @HAVE_ERROR@
(int __status, int __errnum, const char *__format, ...));
# ifndef _GL_NO_INLINE_ERROR
# define error(status, ...) \
- ((error)(0, __VA_ARGS__), (status) ? exit (status) : (void)0)
+ ((error)(0, __VA_ARGS__), (status) != 0 ? exit (status) : (void)0)
# endif
#endif
#if __GLIBC__ >= 2
# ifndef _GL_NO_INLINE_ERROR
# undef error_at_line
# define error_at_line(status, ...) \
- ((rpl_error_at_line)(0, __VA_ARGS__), (status) ? exit (status) : (void)0)
+ ((rpl_error_at_line)(0, __VA_ARGS__), (status) != 0 ? exit (status) : (void)0)
# endif
#else
# if ! @HAVE_ERROR_AT_LINE@
unsigned int __lineno, const char *__format, ...));
# ifndef _GL_NO_INLINE_ERROR
# define error_at_line(status, ...) \
- ((error_at_line)(0, __VA_ARGS__), (status) ? exit (status) : (void)0)
+ ((error_at_line)(0, __VA_ARGS__), (status) != 0 ? exit (status) : (void)0)
# endif
#endif
_GL_CXXALIASWARN (error_at_line);