All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: linux-man@vger.kernel.org, Oskari Pirhonen <xxc3ncoredxx@gmail.com>
Cc: Brian Inglis <Brian.Inglis@Shaw.ca>,
	Matt Jolly <Matt.Jolly@footclan.ninja>,
	Guillem Jover <guillem@hadrons.org>
Subject: Re: Revert "Many Pages: Remove references to C89"
Date: Wed, 15 Mar 2023 13:30:30 +0100	[thread overview]
Message-ID: <d3aee611-844b-fba3-5642-16b0ddc576a3@gmail.com> (raw)
In-Reply-To: <ZBAIkHrBm50vjSqL@dj3ntoo>


[-- Attachment #1.1: Type: text/plain, Size: 3871 bytes --]

Hi Oskari,

On 3/14/23 06:39, Oskari Pirhonen wrote:
> 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.

stdc89()
{
    grep "[[:alpha:]] \**\b$1([[:alnum:]*,. ]*);" /path/to/c89-draft.txt \
    | sort \
    | uniq;
}

That seems to be enough.  I don't know if in some cases there will be
whitespace difference that will make this not work, but I tried with
'printf' and 'gets' and it seems to work so far.

> 
> 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.

Interesting idea.  Sounds fun to do.  I'll check if we can redistribute
the drafts of the standard in the Linux man-pages repo.  If so, we could
have the standard .txt files in some directory inside the repo, and then
have a script that reads those files.

> 
> ... 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.

Nice :)

> 
> Much appreciated :)

You're welcome :-)

> 
> - Oskari

Cheers,

Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-03-15 12:31 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
2023-03-15 12:30             ` Alejandro Colomar [this message]
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=d3aee611-844b-fba3-5642-16b0ddc576a3@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=Brian.Inglis@Shaw.ca \
    --cc=Matt.Jolly@footclan.ninja \
    --cc=guillem@hadrons.org \
    --cc=linux-man@vger.kernel.org \
    --cc=xxc3ncoredxx@gmail.com \
    /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.