[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
O_BINARY no longer defined
From: |
Akim Demaille |
Subject: |
O_BINARY no longer defined |
Date: |
Fri, 9 Aug 2019 05:29:04 -0500 |
Hi Paul,
Bison no longer compiles cleanly on Travis' Ubuntu Xenial. Something must have
changed recently (on Travis): builds that used to pass now fail with
(https://travis-ci.org/akimd/bison/jobs/569747063):
> In file included from lib/pipe2.c:25:0:
> lib/binary-io.h: In function '__gl_setmode':
> lib/binary-io.h:52:10: error: 'O_BINARY' undeclared (first use in this
> function)
> return O_BINARY;
> ^
> lib/binary-io.h:52:10: note: each undeclared identifier is reported only once
> for each function it appears in
> lib/pipe2.c: In function 'pipe2':
> lib/pipe2.c:70:43: error: 'O_BINARY' undeclared (first use in this function)
> if ((flags & ~(O_CLOEXEC | O_NONBLOCK | O_BINARY | O_TEXT)) != 0)
> ^
> lib/pipe2.c:70:54: error: 'O_TEXT' undeclared (first use in this function)
> if ((flags & ~(O_CLOEXEC | O_NONBLOCK | O_BINARY | O_TEXT)) != 0)
> ^
> Makefile:4604: recipe for target 'lib/lib_libbison_a-pipe2.o' failed
I have had a quick look at the fcntl-h module, but I don't see anything that
actually checks whether O_BINARY and O_TEXT are defined (at configure time).
config.log contains:
> configure:13097: checking for working fcntl.h
> configure:13205: gcc -o conftest -g -O2 conftest.c >&5
> configure:13205: $? = 0
> configure:13205: ./conftest
> configure:13205: $? = 0
> configure:13221: result: yes
so gnulib's fcntl.h is not installed, we use the system's one. I don't know
how the module fcntl-h is expected to handle this.
It looks like a job for binary-io.h, but it seems to rely on fcntl.h:
> /* For systems that distinguish between text and binary I/O.
> O_BINARY is guaranteed by the gnulib <fcntl.h>. */
> #include <fcntl.h>
>
> [...]
> #if O_BINARY
> # [...]
> #else
> /* On reasonable systems, binary I/O is the only choice. */
> /* Use a function rather than a macro, to avoid gcc warnings
> "warning: statement with no effect". */
> BINARY_IO_INLINE int
> __gl_setmode (int fd _GL_UNUSED, int mode _GL_UNUSED)
> {
> return O_BINARY;
> }
> #endif
Cheers!
- O_BINARY no longer defined,
Akim Demaille <=