On 05/12/2012 07:00 PM, Bruno Haible wrote:
> +# define set_binary_mode(fd, mode) ((void) (fd), (void) (mode), O_BINARY)
With that approach, code like this:
set_binary_mode (current->desc, prev_mode);
yields the following undesirable diagnostic:
io.c:127:8: error: statement with no effect [-Werror=unused-value]
How about something like the following definition instead?
It would also have the advantage of better type-checking on
POSIX hosts.
static int
set_binary_mode (int fd, int mode)
{
(void) fd;
(void) mode;
return O_BINARY;
}