bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir on mingw


From: Jim Meyering
Subject: Re: mkdir on mingw
Date: Sun, 20 Apr 2008 21:00:33 +0200

Bruno Haible <address@hidden> wrote:

> Hi,
>
> On mingw, I get these compilation warnings and errors:
>
>
> mkdir.c: In function `rpl_mkdir':
> mkdir.c:56: warning: implicit declaration of function `mkdir'
>
> mkdir-p.c: In function `make_dir_parents':
> mkdir-p.c:131: error: too many arguments to function `rpl_mkdir'
> make[3]: *** [mkdir-p.o] Error 1
>
> mkdirat:
>
> In file included from mkdirat.c:42:
> at-func.c: In function `mkdirat':
> at-func.c:38: error: too many arguments to function `rpl_mkdir'
> at-func.c:38: error: too many arguments to function `rpl_mkdir'
> at-func.c:45: error: too many arguments to function `rpl_mkdir'
> at-func.c:45: error: too many arguments to function `rpl_mkdir'
> at-func.c:73: error: too many arguments to function `rpl_mkdir'
> at-func.c:73: error: too many arguments to function `rpl_mkdir'
> make[3]: *** [mkdirat.o] Error 1
>
> tempname:
>
> tempname.c: In function `gen_tempname':
> tempname.c:277: error: too many arguments to function `rpl_mkdir'
> make[3]: *** [tempname.o] Error 1
>
>
> Recall that the declaration of mkdir in <io.h> on mingw has 1 argument,
> whereas the POSIX replacement must have 2 arguments.
>
> The trouble comes because gnulib has two different replacements for mkdir,
> one in module 'sys_stat' for mingw and one in module 'mkdir'. The latter
> puts a '#define mkdir rpl_mkdir' into <config.h> (because its test program
> doesn't compile, due to the different argument counts). Later, when
> <fcntl.h>, <dirent.h>, or <unistd.h> is included, it includes <io.h> and
> thus declares rpl_mkdir (not mkdir!) to have 1 argument.
>
> Additionally, in the config I got (mingw cross from cygwin), HAVE_DECL_MKDIR
> is 1, which disables the rpl_mkdir definition in sys_stat.in.h. A bug here
> too, because the comment says that mkdir is defined depending on compilation
> flags - but we _always_ need this rpl_mkdir on mingw. It will be more
> maintainable here to use a hardcoded test for mingw, rather than to test
> whether mkdir is declared.
>
> OK to commit this fix (assuming it passes my tests tomorrow)?

Ok by me.
Thanks for working on that.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]