2009-10-28 Jim Meyering <meyering@redhat.com>
+ fprintftime: avoid a warning about ignored fwrite return value
+ * lib/strftime.c [FPRINTFTIME]: Include "ignore-value.h".
+ (cpy) [FPRINTFTIME]: Ignore fwrite failure, even though technically,
+ that is unsafe.
+ * modules/fprintftime (Depends-on): Add ignore-value.
+
exclude: avoid an unwarranted warning
* lib/exclude.c (excluded_file_name): Initialize "rc" before switch.
# else
# include "strftime.h"
# endif
+# include "ignore-value.h"
#endif
#include <ctype.h>
else if (to_uppcase) \
fwrite_uppcase (p, (s), _n); \
else \
- fwrite ((s), _n, 1, p))
+ { \
+ /* We are ignoring the value of fwrite here, in spite of the \
+ fact that technically, that may not be valid: the fwrite \
+ specification in POSIX 2008 defers to that of fputc, which \
+ is intended to be consistent with the one from ISO C, \
+ which permits failure due to ENOMEM *without* setting the \
+ stream's error indicator. */ \
+ ignore_value (fwrite ((s), _n, 1, p))); \
+ }
#else
# define cpy(n, s) \
add ((n), \