AC_TYPE_LONG_LONG_INT busted in current Autoconf

Nick Bowler <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Hi,

In recent versions of Autoconf, AC_TYPE_LONG_LONG_INT (and
AC_TYPE_UNSIGNED_LONG_LONG_INT) wrongly indicate that (unsigned) long
long is supported on compilers which actually do not support it.

Looking at the implementation of AC_TYPE_LONG_LONG_INT, it contains:

  ac_cv_type_long_long_int=yes
  case $ac_prog_cc_stdc in
  no | c89) ;;
  *) [ run compiler probes ]
  esac

which looks like it is assuming "long long" is supported for
pre-standard and C89 compilers, only actually running checks
on compilers which support newer C standards; presumably this
is the opposite of what is intended.

The failure is easy to demonstrate with gcc:

  % cat >configure.ac <<'EOF
  AC_INIT([test], [0])
  AC_PROG_CC
  AC_TYPE_LONG_LONG_INT
  AC_OUTPUT
EOF
  
  % autoconf-2.72 --force
  % ./configure CC='gcc -Werror=long-long'
  [...]
  checking for gcc -Werror=long-long option to enable C11 features... unsupported
  checking for gcc -Werror=long-long option to enable C99 features... unsupported
  checking for gcc -Werror=long-long option to enable C89 features... none needed
  checking for unsigned long long int... yes
  checking for long long int... yes

The last apparently working version is autoconf-2.70, but that is
because this version of autoconf has a different bug which causes it to
believe C89 compilers support C99 (so the long long test is run in this
version).  The last actually working version is autoconf-2.69:

  % autoconf-2.69 --force
  % ./configure CC='gcc -Werror=long-long'
  [...]
  checking for gcc -Werror=long-long option to accept ISO C89... none needed
  checking for unsigned long long int... no
  checking for long long int... no

Cheers,
  Nick
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.