Re: msvc-inval: more options

2011-09-28 Thread Jim Meyering
Bruno Haible wrote: FAIL: test-fgetc.exe FAIL: test-fputc.exe FAIL: test-fread.exe FAIL: test-fwrite.exe All these fail on a stream whose file descriptor has been closed. Most libraries won't do such a thing. Therefore I don't find it worth to fix this. Just document it. But two of the

Re: msvc-inval: more options

2011-09-28 Thread Bruno Haible
Hi Jim, I noticed that the latest from gnulib's tests gets some new warnings when compiled on Fedora 15: test-fread.c: In function 'main': test-fread.c:43:3: error: implicit declaration of function 'gl_msvc_inval_ensure_handler' [-Werror=implicit-function-declaration] Oops, yes,

Re: msvc-inval: more options

2011-09-28 Thread Jim Meyering
Bruno Haible wrote: I noticed that the latest from gnulib's tests gets some new warnings when compiled on Fedora 15: test-fread.c: In function 'main': test-fread.c:43:3: error: implicit declaration of function gl_msvc_inval_ensure_handler' [-Werror=implicit-function-declaration]

Re: msvc-inval: more options

2011-09-28 Thread Bruno Haible
Jim Meyering wrote: -#if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING gl_msvc_inval_ensure_handler (); #endif That is a detail specific to MSVC. Why impose the readability

Re: msvc-inval: more options

2011-09-28 Thread Jim Meyering
Bruno Haible wrote: Jim Meyering wrote: -#if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING gl_msvc_inval_ensure_handler (); #endif That is a detail specific to MSVC. Why

Re: msvc-inval: more options

2011-09-27 Thread Bruno Haible
FAIL: test-fgetc.exe FAIL: test-fputc.exe FAIL: test-fread.exe FAIL: test-fwrite.exe All these fail on a stream whose file descriptor has been closed. Most libraries won't do such a thing. Therefore I don't find it worth to fix this. Just document it. But two of the tests still fail, and

Re: msvc-inval: more options

2011-09-26 Thread Paolo Bonzini
On 09/25/2011 11:46 PM, Bastien ROUCARIES wrote: Did you seehttp://bugs.python.org/issue4804 ? Particularlyhttp://bugs.python.org/file12953/__pioinfo.patch A little bit hackhish but seems to work That would provide a lot more flexibility, including: * the ability to implement O_INHERIT

Re: msvc-inval: more options

2011-09-26 Thread Bastien ROUCARIES
On Mon, Sep 26, 2011 at 9:01 AM, Paolo Bonzini bonz...@gnu.org wrote: On 09/25/2011 11:46 PM, Bastien ROUCARIES wrote: Did you seehttp://bugs.python.org/issue4804  ? Particularlyhttp://bugs.python.org/file12953/__pioinfo.patch A little bit hackhish but seems to work That would provide a

Re: msvc-inval: more options

2011-09-26 Thread Paolo Bonzini
On 09/26/2011 10:37 AM, Bastien ROUCARIES wrote: python seehttp://svn.python.org/projects/python/trunk/Modules/posixmodule.c seems to have solved a lot the maintenabilty stuff by determining the actual size of the structure is determined at runtime. Still hackish, though slightly better. What

Re: msvc-inval: more options

2011-09-26 Thread Bruno Haible
Particularlyhttp://bugs.python.org/file12953/__pioinfo.patch A little bit hackhish but seems to work ... However, it is bad that these data structures can change for every version of MSVC. Additionally, there's a legal problem here: Code like +#define IOINFO_L2E 5 +#define

Re: msvc-inval: more options

2011-09-26 Thread Paolo Bonzini
On 09/26/2011 11:01 AM, Bruno Haible wrote: Additionally, there's a legal problem here: Code like Stopped reading here. Do not include snippets, we _can_ do clean-room reverse engineering if necessary. We can also take code from Wine's MSVCRT implementation if need be, so that at least it

Re: msvc-inval: more options

2011-09-26 Thread Bastien ROUCARIES
On Mon, Sep 26, 2011 at 11:06 AM, Paolo Bonzini bonz...@gnu.org wrote: On 09/26/2011 11:01 AM, Bruno Haible wrote: Additionally, there's a legal problem here: Code like Stopped reading here.  Do not include snippets, we _can_ do clean-room reverse engineering if necessary. We can also take

msvc-inval: more options

2011-09-25 Thread Bruno Haible
On MSVC, it is not only possible to install, through _set_invalid_parameter_handler, a handler that transfers control to a point where the program (in this case, gnulib) can provide a sensible return value or error return to a particular function. It is also possible to install a handler that

Re: msvc-inval: more options

2011-09-25 Thread Bruno Haible
+ * The default way, which is reasonable for programs (not libraries): + AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING]) + + * The way for libraries that make hairy calls (like close(-1), or + fclose(fp) where fileno(fp) is closed, or simply

Re: msvc-inval: more options

2011-09-25 Thread Bastien ROUCARIES
Did you see http://bugs.python.org/issue4804 ? Particularly http://bugs.python.org/file12953/__pioinfo.patch A little bit hackhish but seems to work Thanks bastien On Sun, Sep 25, 2011 at 11:30 PM, Bruno Haible br...@clisp.org wrote: +     * The default way, which is reasonable for programs