Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ANSI C standard of zsh



> 2024/03/27 8:16、Clinton Bunch <cdb_zsh@xxxxxxxxxxx>のメール:
> 
> If we're going to say Zsh expects C99 we should probably update
> autoconf to check for C99 (and set any options needed)
> 
> I've attached a patch for the trivial change needed.
in the attached patch:
> -AC_PROG_CC
> +AC_PROG_CC_C99

We can use AC_PROG_CC_C99 with autoconf-2.69, but in 2.7x
it became obsolete and we need to use AC_PROG_CC, which
tries C11, C99 and C89 (in this order) to find the latest
edition the compiler supports.

So we first need to decide which version of autoconf we
use. Maybe we will continue using 2.69 for the moment?


The following is info for someone who wants to know
what AC_PROG_CC_C99 will check.
In the comment to the AC_PROG_CC_C99 macro in c.m4
(may be in /usr/share/autoconf/autoconf/ if you have 2.69
installed, or lib/autoconf/ in the autoconf source tree):

# It (AC_PROG_CC_C99) considers the compiler to be in ISO C99
# mode if it handles
# _Bool,
# // comments,
# flexible array members,          # aka incomplete array
# inline,
# long long int,
# mixed code and declarations,
# named initialization of structs, # aka designated initializer
# restrict,
# va_copy,                  # with <stdarg.h> and va_start etc.
# varargs macros,        # macros with variable number of args
# variable declarations in for loops      # for(int i=0; ...)
# variable length arrays

Note that "variable length array" (optional in C11) is
required.

AC_PROG_CC_C99 does not check, for example (not comprehensive):
headers other than <stdarg.h>, i.e., <complex.h>, <stdbool.h>,
   <tgmath.h>, <intypes.h>, etc.
snprintf() (and any other new library functions)
universal character name: \uNNNN, \UNNNNNNNN
compound literal





Messages sorted by: Reverse Date, Date, Thread, Author