List Archive

Thread

Thread Index

Message

From: Thomas Klausner <tk%giga.or.at@localhost>
To: Benjamin Gilbert <bgilbert%backtick.net@localhost>
Subject: Re: MinGW-w64 build failure with 1.3.1 and 1.3.2
Date: Mon, 20 Nov 2017 13:07:02 +0100

On Mon, Nov 20, 2017 at 06:53:31AM -0500, Benjamin Gilbert wrote:
> libzip 1.3.1 and 1.3.2 fail to build with MinGW-w64:
> 
> nonrandomopentest.c: In function 'main':
> nonrandomopentest.c:51:39: error: macro "open" requires 3 arguments, but
> only 2 given
>      fd = open("/dev/urandom", O_RDONLY);
>                                        ^
> nonrandomopentest.c:51:8: warning: assignment makes integer from pointer
> without a cast [-Wint-conversion]
>      fd = open("/dev/urandom", O_RDONLY);
>         ^
> make[2]: *** [Makefile:947: nonrandomopentest.o] Error 1

This looks like a problem in MinGW. POSIX defines open like this:

int open(const char *path, int oflag, ...)

i.e. two arguments are required, more are allowed. See

http://pubs.opengroup.org/onlinepubs/009695399/functions/open.html

 Thomas

Made by MHonArc.