Re: open_safer on amd64

2009-05-22 Thread Jim Meyering
Bruno Haible wrote: Eric Blake wrote: We could also check at configure time for AC_CHECK_SIZEOF([mode_t]), then use the preprocessor to skip the unneeded branch altogether using the appropriate macro from config.h. Yes. Paul Eggert tried to avoid configure-time checks that could also be done

Re: open_safer on amd64

2009-05-21 Thread Sergey Poznyakoff
Bruno Haible br...@clisp.org ha escrit: You can ignore this warning. The code is fine. Ah, OK. Thank you. Perhaps it merits mentioning in the docs, to avoid further reports of this kind? Regards, Sergey

Re: open_safer on amd64

2009-05-21 Thread Sergey Poznyakoff
Eric Blake e...@byu.net ha escrit: In earlier versions of POSIX, the intent was that mode_t could be narrower than int, and that all programmers had to use only symbolic constants in that argument. As a side note, on that particular architecture, mode_t is indeed narrower than int. Regards,

Re: open_safer on amd64

2009-05-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 5/20/2009 5:08 PM: You can ignore this warning. The code is fine. We know no way of getting rid of this warning, except by passing fewer warning options to gcc. We could also check at configure time for

Re: open_safer on amd64

2009-05-21 Thread Bruno Haible
Eric Blake wrote: We could also check at configure time for AC_CHECK_SIZEOF([mode_t]), then use the preprocessor to skip the unneeded branch altogether using the appropriate macro from config.h. Yes. Paul Eggert tried to avoid configure-time checks that could also be done at compile-time. But

open_safer on amd64

2009-05-20 Thread Sergey Poznyakoff
Hello, When trying to compile open-safer.c on amd64 I get: open-safer.c: In function 'open_safer': open-safer.c:46: warning: 'mode_t' is promoted to 'int' when passed through '...' open-safer.c:46: warning: (so you should pass 'int' not 'mode_t' to 'va_arg') open-safer.c:46: note: if this code

Re: open_safer on amd64

2009-05-20 Thread Bruno Haible
Sergey Poznyakoff wrote: When trying to compile open-safer.c on amd64 I get: open-safer.c: In function 'open_safer': open-safer.c:46: warning: 'mode_t' is promoted to 'int' when passed through '...' open-safer.c:46: warning: (so you should pass 'int' not 'mode_t' to 'va_arg')

Re: open_safer on amd64

2009-05-20 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 5/20/2009 5:08 PM: Sergey Poznyakoff wrote: When trying to compile open-safer.c on amd64 I get: open-safer.c: In function 'open_safer': open-safer.c:46: warning: 'mode_t' is promoted to 'int' when passed through

Re: open_safer on amd64

2009-05-20 Thread Ben Pfaff
Eric Blake e...@byu.net writes: In earlier versions of POSIX, the intent was that mode_t could be narrower than int, and that all programmers had to use only symbolic constants in that argument. But POSIX 2008 changed its stance by adding these words: The sys/stat.h header shall define the