zsh-workers
 help / color / mirror / code / Atom feed
From: Clinton Bunch <cdb_zsh@zentaur.org>
To: zsh-workers@zsh.org
Subject: Re: ANSI C standard of zsh
Date: Tue, 26 Mar 2024 18:16:49 -0500	[thread overview]
Message-ID: <942b86c4-6dec-4b6c-aeb3-5ca1eafbaa03@zentaur.org> (raw)
In-Reply-To: <727e3cdf-f00c-43cc-9965-5451975731fd@zentaur.org>

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

On 3/25/2024 19:32, Clinton Bunch wrote:
> On 3/25/2024 18:47, Oliver Kiddle wrote:
>> Clinton Bunch wrote:
>>> Here is my first cut at replacement wording for the first two 
>>> paragraphs
>>> of the C coding style section:
>> This looks good to me.
>>
>>> If you wish to use features not present in the ANSI C 99 standard, 
>>> there
>>> are preprocessor macros to provide safe access to some of these.  
>>> Always
>>> use the macros if you want to use these facilities.
>> I was trying to think how this reads to someone completely unfamiliar
>> with the zsh code and what macros we have that meet this description.
>> Autoconf detects mostly system library/OS features and the macros
>> related to that are either defined to 1 (or left undefined). So the
>> macros allow you to make the use of such features conditional. "provide
>> safe access" sounds more like a wrapper – I couldn't think of an
>> example but that's not to say there aren't any. The preprocessor macros
>> are for anything that isn't portable rather than a particular language
>> standard.
>>
>> Oliver
> I think what was intended was macros like _POSIX_C_SOURCE and 
> _XOPEN_SOURCE and __STDC__.  The glibc man pages are littered with them.
>
>
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.



[-- Attachment #2: zsh-autoconf-c99.patch.txt --]
[-- Type: text/plain, Size: 383 bytes --]

diff --git a/configure.ac b/configure.ac
index 78621042d..5984b667e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -462,7 +462,7 @@ dnl We want these before the checks, so the checks can modify their values.
 test -z "${CFLAGS+set}"  && CFLAGS=  auto_cflags=1
 test -z "${LDFLAGS+set}" && LDFLAGS= auto_ldflags=1
 
-AC_PROG_CC
+AC_PROG_CC_C99
 
 dnl Check for large file support.
 

  reply	other threads:[~2024-03-26 23: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 [this message]
2024-03-28  9:16             ` Jun T
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=942b86c4-6dec-4b6c-aeb3-5ca1eafbaa03@zentaur.org \
    --to=cdb_zsh@zentaur.org \
    --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).