Re: [PATCH] fstatat: support NULL if AT_EMPTY_PATH

Bruno Haible via Gnulib discussion list <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Organization GNU
Message-ID <6281738.UjTJXf6HLC@nimes>
Paul Eggert wrote:
> diff --git a/m4/fstatat.m4 b/m4/fstatat.m4
> index d53e8d9196..ceeb211d34 100644
> --- a/m4/fstatat.m4
> +++ b/m4/fstatat.m4
...
> +           [gl_saved_CFLAGS=$CFLAGS
> +            CFLAGS="$CFLAGS -Wno-nonnull"
> +            AC_RUN_IFELSE(
...

I think two things are wrong here:

  - A missing statement
      CFLAGS=$gl_saved_CFLAGS
    after the AC_RUN_IFELSE macro.

  - The -Wno-nonnull option surely works only with gcc, clang, and
    compatible compilers. How about testing whether -Wno-nonnull
    works, first?

    AC_CACHE_CHECK([whether -Wnonnull is supported],
      [gl_cv_cc_nonnull_supported],
      [gl_saved_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS -Wnonnull"
       AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM([[]], [[]])],
         [gl_cv_cc_nonnull_supported=yes],
         [gl_cv_cc_nonnull_supported=no])
       CFLAGS="$gl_saved_CFLAGS"
      ])

Bruno
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.