projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c5d62fd
)
Improve *printf warning condition.
author
Bruno Haible
<bruno@clisp.org>
Sun, 21 Feb 2010 00:04:28 +0000
(
01:04
+0100)
committer
Bruno Haible
<bruno@clisp.org>
Sun, 21 Feb 2010 00:04:28 +0000
(
01:04
+0100)
ChangeLog
patch
|
blob
|
history
lib/stdio.in.h
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 616195c9cead93ef34f40539b48a6cd599477b66..5f955bfbd5bd7f0b07b8d05ce6898805f14e5c19 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,10
@@
+2010-02-20 Bruno Haible <bruno@clisp.org>
+
+ Improve *printf warning condition.
+ * lib/stdio.in.h (fprintf, printf, vfprintf, vprintf): Emit warning
+ also if GNULIB_POSIXCHECK is defined, the *-posix module is not used,
+ and the function is overridden due to SIGPIPE emulation.
+
2010-02-20 Bruno Haible <bruno@clisp.org>
* lib/stdio.in.h: Tweak comments.
2010-02-20 Bruno Haible <bruno@clisp.org>
* lib/stdio.in.h: Tweak comments.
diff --git
a/lib/stdio.in.h
b/lib/stdio.in.h
index b4dcf872776b61b55cbe01ab5f7f722f0a4df0db..299b7c4e452e9332f6319f332a746e9d1c91144e 100644
(file)
--- a/
lib/stdio.in.h
+++ b/
lib/stdio.in.h
@@
-133,20
+133,20
@@
_GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
"use gnulib module fopen for portability");
#endif
"use gnulib module fopen for portability");
#endif
-#if @GNULIB_FPRINTF_POSIX@
-# if @REPLACE_FPRINTF@
+#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
+ || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
# define fprintf rpl_fprintf
# define fprintf rpl_fprintf
+# define GNULIB_overrides_fprintf 1
extern int fprintf (FILE *fp, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)))
_GL_ARG_NONNULL ((1, 2));
# endif
extern int fprintf (FILE *fp, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)))
_GL_ARG_NONNULL ((1, 2));
# endif
-#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)))
- _GL_ARG_NONNULL ((1, 2));
-#elif defined GNULIB_POSIXCHECK
-# undef fprintf
+#endif
+#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_fprintf
+# undef fprintf
+# endif
/* Assume fprintf is always declared. */
_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
"use gnulib module fprintf-posix for portable "
/* Assume fprintf is always declared. */
_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
"use gnulib module fprintf-posix for portable "
@@
-439,20
+439,20
@@
_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
# endif
#endif
# endif
#endif
-#if @GNULIB_PRINTF_POSIX@
-# if @REPLACE_PRINTF@
+#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
+ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
/* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__
+# define GNULIB_overrides_printf 1
extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
# endif
extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
# endif
-#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-/* Don't break __attribute__((format(printf,M,N))). */
-# define printf __printf__
-extern int printf (const char *format, ...)
- __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
-#elif defined GNULIB_POSIXCHECK
-# undef printf
+#endif
+#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_printf
+# undef printf
+# endif
/* Assume printf is always declared. */
_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
"use gnulib module printf-posix for portable "
/* Assume printf is always declared. */
_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
"use gnulib module printf-posix for portable "
@@
-595,38
+595,39
@@
_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# endif
#endif
# endif
#endif
-#if @GNULIB_VFPRINTF_POSIX@
-# if @REPLACE_VFPRINTF@
+#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
+ || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
# define vfprintf rpl_vfprintf
# define vfprintf rpl_vfprintf
+# define GNULIB_overrides_vfprintf 1
extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)))
_GL_ARG_NONNULL ((1, 2));
# endif
extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)))
_GL_ARG_NONNULL ((1, 2));
# endif
-#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)))
- _GL_ARG_NONNULL ((1, 2));
-#elif defined GNULIB_POSIXCHECK
-# undef vfprintf
+#endif
+#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vfprintf
+# undef vfprintf
+# endif
/* Assume vfprintf is always declared. */
_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
"use gnulib module vfprintf-posix for portable "
"POSIX compliance");
#endif
/* Assume vfprintf is always declared. */
_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
"use gnulib module vfprintf-posix for portable "
"POSIX compliance");
#endif
-#if @GNULIB_VPRINTF_POSIX@
-# if @REPLACE_VPRINTF@
+#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
+ || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
# define vprintf rpl_vprintf
# define vprintf rpl_vprintf
+# define GNULIB_overrides_vprintf 1
extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
# endif
extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
# endif
-#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
-#elif defined GNULIB_POSIXCHECK
-# undef vprintf
+#endif
+#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vprintf
+# undef vprintf
+# endif
/* Assume vprintf is always declared. */
_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
"use gnulib module vprintf-posix for portable "
/* Assume vprintf is always declared. */
_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
"use gnulib module vprintf-posix for portable "