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 > at compile-time. But at this point we are getting GCC warnings repeatedly, at > the same spot. > > A single AC_TRY_COMPILE will be quicker than AC_CHECK_SIZEOF. > > I propose the following patch. Jim, objections? > > 2009-05-21 Bruno Haible <br...@clisp.org> > > Simplify use of mode_t varargs. > * lib/open.c (open): Use PROMOTED_MODE_T instead of a conditional that > uses 'mode_t' or 'int'. > * lib/openat.c (openat): Likewise. > * lib/open-safer.c (open_safer): Likewise. > * m4/mode_t.m4: New file. > * m4/open.m4 (gl_PREREQ_OPEN): Require gl_PROMOTED_TYPE_MODE_T. > * m4/openat.m4 (gl_PREREQ_OPENAT): Likewise. > * m4/fcntl-safer.m4 (gl_FCNTL_SAFER): Likewise. > * modules/open (Files): Add m4/mode_t.m4. > * modules/openat (Files): Likewise. > * modules/fcntl-safer (Files): Likewise. > Suggested by Eric Blake.
Looks perfect. Thank you!