public inbox for linux-man@vger.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:53:04 +0100	[thread overview]
Message-ID: <6da28b50-e086-acde-6bb0-0409ada022d6@gmail.com> (raw)
In-Reply-To: <d3aee611-844b-fba3-5642-16b0ddc576a3@gmail.com>


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

Hi Oskari,

On 3/15/23 13:30, Alejandro Colomar wrote:
> stdc89()
> {
>     grep "[[:alpha:]] \**\b$1([[:alnum:]*,. ]*);" /path/to/c89-draft.txt \
>     | sort \
>     | uniq;
> }

I found a bug.  I was missing '_' in identifier names.  So it didn't
match memcpy(3), which uses size_t.  Also, I found some spurious match,
so added a '$' anchor after the ';'.


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


This function finds 136 declarations in C89.  I'm not sure if that's
all of them.  Is anyone missing any?

Cheers,

Alex


$ stdc89 '[[:alpha:]][[:alnum:]]\+' | wc -l
136
$ stdc89 '[[:alpha:]][[:alnum:]]\+'
         FILE *fopen(const char *filename, const char *mode);
         FILE *tmpfile(void);
         char *asctime(const struct tm *timeptr);
         char *ctime(const time_t *timer);
         char *fgets(char *s, int n, FILE *stream);
         char *getenv(const char *name);
         char *gets(char *s);
         char *setlocale(int category, const char *locale);
         char *strcat(char *s1, const char *s2);
         char *strchr(const char *s, int c);
         char *strcpy(char *s1, const char *s2);
         char *strerror(int errnum);
         char *strncat(char *s1, const char *s2, size_t n);
         char *strncpy(char *s1, const char *s2, size_t n);
         char *strpbrk(const char *s1, const char *s2);
         char *strrchr(const char *s, int c);
         char *strstr(const char *s1, const char *s2);
         char *strtok(char *s1, const char *s2);
         char *tmpnam(char *s);
         clock_t clock(void);
         div_t div(int numer, int denom);
         double acos(double x);
         double asin(double x);
         double atan(double x);
         double atan2(double y, double x);
         double atof(const char *nptr);
         double ceil(double x);
         double cos(double x);
         double cosh(double x);
         double difftime(time_t time1, time_t time0);
         double exp(double x);
         double fabs(double x);
         double floor(double x);
         double fmod(double x, double y);
         double frexp(double value, int *exp);
         double ldexp(double x, int exp);
         double log(double x);
         double log10(double x);
         double modf(double value, double *iptr);
         double pow(double x, double y);
         double sin(double x);
         double sinh(double x);
         double sqrt(double x);
         double strtod(const char *nptr, char **endptr);
         double tan(double x);
         double tanh(double x);
         extern int atoi(const char *);
         extern void *alloc();
         int abs(int j);
         int atoi(const char *nptr);
         int fclose(FILE *stream);
         int feof(FILE *stream);
         int ferror(FILE *stream);
         int fflush(FILE *stream);
         int fgetc(FILE *stream);
         int fgetpos(FILE *stream, fpos_t *pos);
         int fprintf(FILE *stream, const char *format, ...);
         int fputc(int c, FILE *stream);
         int fputs(const char *s, FILE *stream);
         int fscanf(FILE *stream, const char *format, ...);
         int fseek(FILE *stream, long int offset, int whence);
         int fsetpos(FILE *stream, const fpos_t *pos);
         int getc(FILE *stream);
         int getchar(void);
         int isalnum(int c);
         int isalpha(int c);
         int iscntrl(int c);
         int isdigit(int c);
         int isgraph(int c);
         int islower(int c);
         int isprint(int c);
         int ispunct(int c);
         int isspace(int c);
         int isupper(int c);
         int isxdigit(int c);
         int mblen(const char *s, size_t n);
         int mbtowc(wchar_t *pwc, const char *s, size_t n);
         int memcmp(const void *s1, const void *s2, size_t n);
         int printf(const char *format, ...);
         int putc(int c, FILE *stream);
         int putchar(int c);
         int puts(const char *s);
         int raise(int sig);
         int rand(void);
         int remove(const char *filename);
         int rename(const char *old, const char *new);
         int scanf(const char *format, ...);
         int setjmp(jmp_buf env);
         int setvbuf(FILE *stream, char *buf, int mode, size_t size);
         int sprintf(char *s, const char *format, ...);
         int sscanf(const char *s, const char *format, ...);
         int strcmp(const char *s1, const char *s2);
         int strcoll(const char *s1, const char *s2);
         int strncmp(const char *s1, const char *s2, size_t n);
         int system(const char *string);
         int tolower(int c);
         int toupper(int c);
         int ungetc(int c, FILE *stream);
         int vfprintf(FILE *stream, const char *format, va_list arg);
         int vprintf(const char *format, va_list arg);
         int vsprintf(char *s, const char *format, va_list arg);
         int wctomb(char *s, wchar_t wchar);
         ldiv_t ldiv(long int numer, long int denom);
         long int atol(const char *nptr);
         long int ftell(FILE *stream);
         long int labs(long int j);
         long int strtol(const char *nptr, char **endptr, int base);
         size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n);
         size_t strcspn(const char *s1, const char *s2);
         size_t strlen(const char *s);
         size_t strspn(const char *s1, const char *s2);
         size_t strxfrm(char *s1, const char *s2, size_t n);
         size_t wcstombs(char *s, const wchar_t *pwcs, size_t n);
         struct lconv *localeconv(void);
         struct tm *gmtime(const time_t *timer);
         struct tm *localtime(const time_t *timer);
         time_t mktime(struct tm *timeptr);
         time_t time(time_t *timer);
         void *calloc(size_t nmemb, size_t size);
         void *malloc(size_t size);
         void *memchr(const void *s, int c, size_t n);
         void *memcpy(void *s1, const void *s2, size_t n);
         void *memmove(void *s1, const void *s2, size_t n);
         void *memset(void *s, int c, size_t n);
         void *realloc(void *ptr, size_t size);
         void abort(void);
         void assert(int expression);
         void clearerr(FILE *stream);
         void exit(int status);
         void f1(int, ...);
         void free(void *ptr);
         void longjmp(jmp_buf env, int val);
         void perror(const char *s);
         void rewind(FILE *stream);
         void setbuf(FILE *stream, char *buf);
         void srand(unsigned int seed);


-- 
<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:53 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
2023-03-15 12:53               ` Alejandro Colomar [this message]
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=6da28b50-e086-acde-6bb0-0409ada022d6@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox