[Patch] Fix type signature of feof and ferror in c++
Corinna Vinschen
vinschen@redhat.com
Thu Dec 11 17:04:00 GMT 2014
On Dec 11 09:08, Jonathan Roelofs wrote:
> This fixes one of the libc++ tests: depr/depr.c.headers/stdio_h.pass.cpp
> diff --git a/ChangeLog b/ChangeLog
> index 5bea065..640bccf 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2014-12-11 Jonathan Roelofs <...>
> +
> + * libc/include/stdio.h: Fix type signature of feof and ferror in c++
> +
Please don't send ChangeLogs as diffs, always plain. They won't apply
cleanly most of the time.
> #ifndef _REENT_SMALL
> -#define feof(p) __sfeof(p)
> -#define ferror(p) __sferror(p)
> +#define feof(p) ((int)__sfeof(p))
> +#define ferror(p) ((int)__sferror(p))
> #define clearerr(p) __sclearerr(p)
> #endif
Wouldn't it make more sense for all targets to move this into the
definitions of __sfeof/__sferror?
Index: libc/include/stdio.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdio.h,v
retrieving revision 1.71
diff -u -p -r1.71 stdio.h
--- libc/include/stdio.h 9 May 2014 14:25:32 -0000 1.71
+++ libc/include/stdio.h 11 Dec 2014 17:03:03 -0000
@@ -649,8 +649,8 @@ _ELIDABLE_INLINE int __sputc_r(struct _r
#endif
#endif
-#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
-#define __sferror(p) (((p)->_flags & __SERR) != 0)
+#define __sfeof(p) ((int)(((p)->_flags & __SEOF) != 0))
+#define __sferror(p) ((int)(((p)->_flags & __SERR) != 0))
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) ((p)->_file)
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20141211/9d4ef201/attachment.sig>
More information about the Newlib
mailing list