This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Breakage with recent libc/stdio/flags.c commit
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: me dot cygwin2012 at cgf dot cx
- Cc: binutils at sourceware dot org
- Date: Thu, 23 Aug 2012 06:13:37 +0200
- Subject: Breakage with recent libc/stdio/flags.c commit
Hi CGF. It seems this patch of yours (which I didn't see on the
list at a glance):
diff -upr --exclude=CVS --exclude=po old/newlib/ChangeLog new/newlib/ChangeLog
--- old/newlib/ChangeLog Fri Aug 10 17:37:33 2012
+++ new/newlib/ChangeLog Tue Aug 21 17:07:22 2012
@@ -1,3 +1,9 @@
+2012-08-21 Christopher Faylor <me.cygwin2012@cgf.cx>
+
+ * libc/stdio/flags.c (__sflags): Rewrite recognition of extended mode
+ flags to just loop over more allowed flags. Support glibc 'e' flag on
+ systems defining _GLIBC_EXTENSION. Support C11 'x' flag.
+
2012-08-10 Corinna Vinschen <vinschen@redhat.com>
* libc/stdlib/btowc.c (btowc): Cast to avoid compiler warning.
diff -upr --exclude=CVS --exclude=po old/newlib/libc/stdio/flags.c new/newlib/libc/stdio/flags.c
--- old/newlib/libc/stdio/flags.c Mon Jun 4 20:10:17 2007
+++ new/newlib/libc/stdio/flags.c Tue Aug 21 17:07:38 2012
@@ -60,27 +60,38 @@ _DEFUN(__sflags, (ptr, mode, optr),
ptr->_errno = EINVAL;
return (0);
}
- if (mode[1] && (mode[1] == '+' || mode[2] == '+'))
+ while (*++mode)
{
- ret = (ret & ~(__SRD | __SWR)) | __SRW;
- m = O_RDWR;
- }
- if (mode[1] && (mode[1] == 'b' || mode[2] == 'b'))
- {
-#ifdef O_BINARY
- m |= O_BINARY;
-#endif
- }
+ switch (*mode)
+ {
+ case '+':
+ ret = (ret & ~(__SRD | __SWR)) | __SRW;
+ m = (m & ~O_ACCMODE) | O_RDWR;
+ break;
+ case 'b':
+ m |= O_BINARY;
+ break;
(rest of patch pruned for brevity)
...is the cause of my cris-elf gcc autotester not being able to
update its newlib due to build breakage when trying:
/tmp/hpautotest-gcc47/cris-elf/gccobj/./gcc/xgcc -B/tmp/hpautotest-gcc47/cris-elf/gccobj/./gcc/ -nostdinc -B/tmp/hpautotest-gcc47/cris-elf/gccobj/cris-elf/v10/newlib/ -isystem /tmp/hpautotest-gcc47/cris-elf/gccobj/cris-elf/v10/newlib/targ-include -isystem /tmp/hpautotest-gcc47/gcc/newlib/libc/include -B/tmp/hpautotest-gcc47/cris-elf/gccobj/cris-elf/v10/libgloss/cris -L/tmp/hpautotest-gcc47/cris-elf/gccobj/cris-elf/v10/libgloss/libnosys -L/tmp/hpautotest-gcc47/gcc/libgloss/cris -B/tmp/hpautotest-gcc47/cris-elf/pre/cris-elf/bin/ -B/tmp/hpautotest-gcc47/cris-elf/pre/cris-elf/lib/ -isystem /tmp/hpautotest-gcc47/cris-elf/pre/cris-elf/include -isystem /tmp/hpautotest-gcc47/cris-elf/pre/cris-elf/sys-include -march=v10 -mbest-lib-options -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.20.0\" -DPACKAGE_STRING=\"newlib\ 1.20.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/tmp/hpautotest-gcc47/gcc/newlib/libc/stdio -DHAVE_RENAME -D_USE_WRITE -DCOMPAC
T_CTYPE -fno-builtin -g -O2 -march=v10 -mbest-lib-options -c -o lib_a-flags.o `test -f 'flags.c' || echo '/tmp/hpautotest-gcc47/gcc/newlib/libc/stdio/'`flags.c
/tmp/hpautotest-gcc47/gcc/newlib/libc/stdio/flags.c: In function '__sflags':
/tmp/hpautotest-gcc47/gcc/newlib/libc/stdio/flags.c:72:9: error: 'O_BINARY' undeclared (first use in this function)
/tmp/hpautotest-gcc47/gcc/newlib/libc/stdio/flags.c:72:9: note: each undeclared identifier is reported only once for each function it appears in
make[8]: *** [lib_a-flags.o] Error 1
Not sure where the O_BINARY is supposed to come from, but it was
obviously optional before. Can you please look into this?
Thanks.
brgds, H-P