This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/2] Windows libcpp: Make path-exists semantics more Posix-like
- From: Pedro Alves <palves at redhat dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Kai Tietz <ktietz at redhat dot com>, Ray Donnelly <mingw dot android at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Kai Tietz <ktietz70 at gmail dot com>
- Date: Fri, 25 Apr 2014 20:24:00 +0100
- Subject: Re: [PATCH 2/2] Windows libcpp: Make path-exists semantics more Posix-like
- Authentication-results: sourceware.org; auth=none
- References: <1397936424-2290-1-git-send-email-mingw dot android at gmail dot com> <1397936424-2290-3-git-send-email-mingw dot android at gmail dot com> <1034557352 dot 9542218 dot 1397940098399 dot JavaMail dot zimbra at redhat dot com> <535A92FD dot 5080009 at redhat dot com> <CAEwic4YU3xtB9dv213Svg5dUWBA0miSkVMrXJ0Hpf+nhhYDo_g at mail dot gmail dot com>
On 04/25/2014 08:05 PM, Kai Tietz wrote:
> 2014-04-25 18:53 GMT+02:00 Pedro Alves <firstname.lastname@example.org>:
>> On 04/19/2014 09:41 PM, Kai Tietz wrote:
>>> Isn't this function something better placed in libiberty? Also this name looks a bit confusing. Wouldn't be a an function calling for _WIN32 case also stat, and just overrides the st_mode member, if it is a link better. So I would put this function to the file_... API of libiberty.
>> I'd even suspect that e.g., GNU Make / Makefiles would be likewise affected
>> by this. A solution for this in gcc, or in a few selected programs
>> only, looks brittle to me. Perhaps it should be mingw itself that provides
>> a _non-default_ replacement as option (similarly to __mingw_printf).
> Of course we could change default-behavior of stat-function within
Huh? I said exactly the opposite. To expose it as a __non-default__
replacement. I pointed at __mingw_printf, so to suggest programs
would call it like __mingw_stat or something, or by defining
__USE_MINGW_POSIX_STAT or something, just like one can define
__USE_MINGW_ANSI_STDIO before including stdio.h. I'll understand
if you wouldn't want to support that as an option, but I did _not_
suggest making it the default.
> This would change documented and exprected behavior of
> msvcrt's implementation. And all this for an assumption made by some
"some ventures" here must be the whole toolchain. Certainly the
whole toolchain needs to agree on path handling. Makefiles were
an obvious example -- if the preprocessor needs needs to find the
right include files, so must Make need this to pick the right
dependencies, isn't it?
This sort of potencially-needing-to-be-fixed-in-many-places issue is
what makes me believe a much better solution would be to just not
rely on this semantics in the first place.
> I think that libiberty is exactly present to unify functionality (and
> API) for different operation systems. Exactly for this libiberty was
> made, isn't it?
libiberty is actually a kitchen sink, and specific to gcc and src.
It does more than host abstraction. Gnulib fills that role much better
nowdays. I'd be nice if gcc used that instead for the host abstraction
parts (gdb does), but nobody's working on that afaik...
> I agree that there are other venture, which might be affected by same
> problem. So those venture could either use libiberty to solve this
> problem too, or need to reimplement it as they do now.
And then we'll have reinvented Cygwin all over the map. ;-)
>> Can't glibc be changed to not rely on this? /me hides.