------- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-09-06 12:25 ------- (In reply to comment #0) > The problem > is that the mode parameter is sometimes set to X_OK (system.h, equals 1).
X_OK is only defined in system.h if it's not defined by system includes. On mingw, X_OK happens to be defined by <io.h>. > The solution I think is to define X_OK as 0 on the MingW Windows platform. > When > the mode is 0 msvcrt's _access tests for existence. Which is pretty close to > the execute right check. The mingw developers have modified their include files to work around this case, and you can get the old behaviour (X_OK is ignored) by compiling with -D__USE_MINGW_ACCESS (see PR33281). I intend to commit a patch that makes us build the compiler with -D__USE_MINGW_ACCESS, thus removing the problem. I thus intend to close that PR. Zack, if you think we shouldn't use access() at all, do you want to keep this PR open and change its title to reflect this desired change? -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org, zackw at panix dot com Status|NEW |WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30972