Re: Revert "Many Pages: Remove references to C89"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux