zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: ANSI C standard of zsh
Date: Thu, 28 Mar 2024 18:16:31 +0900	[thread overview]
Message-ID: <63074C4C-7ADB-4089-AAE5-7E5533595C41@kba.biglobe.ne.jp> (raw)
In-Reply-To: <942b86c4-6dec-4b6c-aeb3-5ca1eafbaa03@zentaur.org>


> 2024/03/27 8:16、Clinton Bunch <cdb_zsh@zentaur.org>のメール:
> 
> 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



  reply	other threads:[~2024-03-28  9:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 21:44 Clinton Bunch
2024-03-13  1:50 ` Clinton Bunch
2024-03-13  4:16 ` Bart Schaefer
2024-03-13  4:22 ` Bart Schaefer
2024-03-13 16:49   ` Oliver Kiddle
2024-03-23 21:26     ` Clinton Bunch
2024-03-25 23:47       ` Oliver Kiddle
2024-03-26  0:32         ` Clinton Bunch
2024-03-26 23:16           ` Clinton Bunch
2024-03-28  9:16             ` Jun T [this message]
2024-03-28 12:29               ` Clinton Bunch
2024-04-04  0:00                 ` Vincent Lefevre
2024-04-04 22:57                   ` Clinton Bunch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63074C4C-7ADB-4089-AAE5-7E5533595C41@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).