All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: linux-man@vger.kernel.org, Brian Inglis <Brian.Inglis@Shaw.ca>,
	Matt Jolly <Matt.Jolly@footclan.ninja>
Subject: Re: Revert "Many Pages: Remove references to C89"
Date: Tue, 14 Mar 2023 00:39:28 -0500	[thread overview]
Message-ID: <ZBAIkHrBm50vjSqL@dj3ntoo> (raw)
In-Reply-To: <591290fb-e78d-ad3a-8b25-4a860d26f775@gmail.com>

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

Hi,

On Mon, Mar 13, 2023 at 13:00:52 +0100, Alejandro Colomar wrote:

... snip ...

> >> <https://port70.net/~nsz/c/c89/c89-draft.txt>
> >>
> >> I suggest you download that file, and use a function like this:
> >>
> >> $ stdc89() { grep "[[:alpha:]] \**\b$1([[:alnum:]*,. ]*);" /path/to/c89-draft.txt; }
> >> $ stdc89 printf
> >>          int printf(const char *format, ...);
> >>          int printf(const char *format, ...);
> >>
> > 
> > I gave this a quick spin and it seems to work decently well. So thanks
> > for that.
> 
> :-)
> 
> > It's still not quite as nice as having C89 mentioned in
> > STANDARDS, and couldn't this be leveraged to fix up the inconsistencies
> > you mentioned earlier?
> 
> Yup, you caught me.  That's what I thought when writing the email.  :p
> 

I played around with this a bit more, and with a little work it should
be possible to query, eg, all the "str*" functions. As it's written,
it's doable with something like this (but not the most elegant):

    $ stdc89 'str[[:alnum:]]*'
    double strtod(const char *nptr, char **endptr);
    long int strtol(const char *nptr, char **endptr, int base);
    char *strcpy(char *s1, const char *s2);
    char *strcat(char *s1, const char *s2);
    int strcmp(const char *s1, const char *s2);
    ...

The duplicates and leading whitespace is a trivial change.

Looking at the site you linked to for the c89-draft.txt, there's also
C99, C11, and C2x. With yet some more work, it'd be possible to have
equivalent functions for those standards as well. They could even be
combined to create an "std-diff" tool to give, eg, new "str*" functions
introduced in C89 -> C99.

Perhaps such a tool already exists, but I thought it worth mentioning
here in case anyone reading this gets inspired to write it. I've added
it to my (ever growing) TODO list, but don't know when I might get
around to actually giving it a go.

... snip ...

> > "Usefulness" seems to be a hard sell for you, but perhaps you would
> > reconsider it based on the historical relevance of C89? It was, after
> > all, the first proper standard of the C language. If you don't want to
> > promote C89 by having it mentioned alongside the others, perhaps you'd
> > be open to the idea of adding a historical note?
> 
> I've been considering something like that for a long time.  The
> STANDARDS section (previously known as CONFORMING TO), is a mix of a
> proper standards section, and what a HISTORY section should contain.
> 
> It would be interesting to do a split, and inaugurate a HISTORY section.
> For that section, I would keep any references to C89, since as you say
> it's historically very relevant.  Thus, I will revert the patch, and later apply some patches that move the info without discarding it.
> 

Well this is good news, and if you ask me, an improvement in the long
run instead of just returning to the status quo.

Much appreciated :)

- Oskari

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-03-14  5:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  1:51 Revert "Many Pages: Remove references to C89" Matt Jolly
2023-03-10  1:51 ` [PATCH] Revert "Many pages: " Matt Jolly
2023-03-10  2:22 ` Revert "Many Pages: " Alejandro Colomar
2023-03-10  5:00   ` Oskari Pirhonen
2023-03-10 13:29     ` Alejandro Colomar
2023-03-10 13:32       ` Alejandro Colomar
2023-03-13  1:42       ` Oskari Pirhonen
2023-03-13 12:00         ` Alejandro Colomar
2023-03-14  5:39           ` Oskari Pirhonen [this message]
2023-03-15 12:30             ` Alejandro Colomar
2023-03-15 12:53               ` Alejandro Colomar
2023-03-15 12:54                 ` Alejandro Colomar
2023-03-15 14:22                 ` Alejandro Colomar
2023-03-15 16:51               ` Brian Inglis
2023-03-15 17:01                 ` Alejandro Colomar
2023-03-15 18:10                   ` Tom Schwindl
2023-03-16  1:43                     ` Alejandro Colomar
2023-03-18  4:58                       ` Oskari Pirhonen
2023-03-22  1:20                         ` Alejandro Colomar
2023-03-15  4:36           ` Guillem Jover
2023-03-10  6:40   ` Brian Inglis
2023-03-10 12:49     ` Alejandro Colomar
2023-03-23  5:32   ` Sam James
2023-03-23 13:13     ` Alejandro Colomar

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=ZBAIkHrBm50vjSqL@dj3ntoo \
    --to=xxc3ncoredxx@gmail.com \
    --cc=Brian.Inglis@Shaw.ca \
    --cc=Matt.Jolly@footclan.ninja \
    --cc=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.