Re: [MinGW-w64]Build gdb/ctf.c failed

Eli Zaretskii
2013-03-25T08:28:49Z

> Date: Mon, 25 Mar 2013 09:06:05 +0100
> From: Kai Tietz <ktietz70@googlemail.com>
> Cc: asmwarrior <asmwarrior@gmail.com>, tromey@redhat.com, yao@codesourcery.com,
> gdb-patches@sourceware.org
>
> 2013/3/25 Eli Zaretskii <eliz@gnu.org>:
> >> Date: Mon, 25 Mar 2013 08:57:59 +0800
> >> From: asmwarrior <asmwarrior@gmail.com>
> >> CC: Eli Zaretskii <eliz@gnu.org>, Yao Qi <yao@codesourcery.com>,
> >> gdb-patches@sourceware.org
> >>
> >> I found that _mkdir was declared in the file: direct.h in MinGW-w64 SDKs:
> >> _CRTIMP int __cdecl _mkdir(const char *_Path);
> >
> > Isn't _mkdir also declared in io.h?
>
> No, it isn't.

Too bad. Gratuitous differences between the different MinGW variants
are likely to become maintenance headaches in the long run. Like in
this case.

> It is a flaw to declare it there. The unistd.h header is a POSIX
> one. _mkdir is for sure no POSIX variant, so its declaration
> doesn't belong somewhere else.

Posix header files can very well (and do) have non-Posix stuff, if
that stuff is guarded by suitable preprocessor conditionals that make
it disappear when compiled with the -std= compiler switch which
requires Posix without extensions. So I'm surprised this argument is
being brought up here.