Re: Comparing binary files with Diff 3.2 compiled with MinGW

Paul Eggert <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs,gmane.comp.lib.gnulib.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
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;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.