diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2023-01-08 12:16:22 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2023-01-08 12:16:22 +0000 |
commit | 8a0d639c7946c024c29e80af4fcd42c7ad5d274f (patch) | |
tree | 863a759b889ccca533683525cd2718b1ac163478 /Build | |
parent | d3cbb6a93ac13791b6bf7b81074c5f4403ff023f (diff) |
[CWEB] C++17 has removed 'register' storage class.
Locally, I compile CWEB amd other C sources with 'g++'. Recently, I
upgraded to Kubuntu 22.04.1 LTS that ships with g++ 11.3.0. This seems
to default to the C++17 standard.
git-svn-id: svn://tug.org/texlive/trunk@65488 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebboot.cin | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ChangeLog | 9 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/comm-mac.ch | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.c | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.w | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwill-w2c.ch | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/refsort.ch | 22 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/twinx.ch | 82 |
9 files changed, 130 insertions, 15 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index 59d5db69082..f91df5352a0 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,7 @@ +2023-01-08 Andreas Scherer <https://ascherer.github.io> + + * cwebboot.cin: C++ has removed 'register' storage class. + 2022-12-28 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * tests/fn-generate.perl, tests/fn-{utf8,euc,sjis}.txt, diff --git a/Build/source/texk/web2c/cwebboot.cin b/Build/source/texk/web2c/cwebboot.cin index 212a8b704c5..679cd46640c 100644 --- a/Build/source/texk/web2c/cwebboot.cin +++ b/Build/source/texk/web2c/cwebboot.cin @@ -621,8 +621,8 @@ fatal(_("! Cannot open output file "),tex_file_name); static boolean input_ln( FILE*fp) { -register int c= EOF; -register char*k; +int c= EOF; +char*k; if(feof(fp))return false; limit= k= buffer; while(k<=buffer_end&&(c= getc(fp))!=EOF&&c!='\n') @@ -1412,7 +1412,7 @@ scan_args(void) { char*dot_pos; char*name_pos; -register char*s; +char*s; boolean found_web= false,found_change= false,found_out= false; diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index c6f2e586629..1587dc98a6a 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,12 @@ +2023-01-08 Andreas Scherer <https://ascherer.github.io> + + * comm-mac.ch, + * common.c, + * common.w, + * ctwill-w2c.ch, + * refsort.ch, + * twinx.ch: C++17 has removed 'register' storage class. + 2022-11-22 Andreas Scherer <https://ascherer.github.io> * cwebmac.tex: Fix border case 'reflect.w'. diff --git a/Build/source/texk/web2c/cwebdir/comm-mac.ch b/Build/source/texk/web2c/cwebdir/comm-mac.ch index 6bad610d1bd..7bf7151dd23 100644 --- a/Build/source/texk/web2c/cwebdir/comm-mac.ch +++ b/Build/source/texk/web2c/cwebdir/comm-mac.ch @@ -18,8 +18,8 @@ support |feof|, |getc|, and |ungetc| you may have to change things here. static boolean input_ln( /* copies a line into |buffer| or returns |false| */ FILE *fp) /* what file to read from */ { - register int c=EOF; /* character read; initialized so some compilers won't complain */ - register char *k; /* where next character goes */ + int c=EOF; /* character read; initialized so some compilers won't complain */ + char *k; /* where next character goes */ if (feof(fp)) return false; /* we have hit end-of-file */ limit = k = buffer; /* beginning of buffer */ while (k<=buffer_end && (c=getc(fp)) != EOF && c!='\n') @@ -46,8 +46,8 @@ line endings, so that \.{CWEB} will works with ASCII files stored in static boolean input_ln( /* copies a line into |buffer| or returns |false| */ FILE *fp) /* what file to read from */ { - register int c=EOF; /* character read; initialized so some compilers won't complain */ - register char *k; /* where next character goes */ + int c=EOF; /* character read; initialized so some compilers won't complain */ + char *k; /* where next character goes */ if (feof(fp)) return false; /* we have hit end-of-file */ limit = k = buffer; /* beginning of buffer */ while (true) { diff --git a/Build/source/texk/web2c/cwebdir/common.c b/Build/source/texk/web2c/cwebdir/common.c index 2b5c7c9ccc6..635c4dfaf9b 100644 --- a/Build/source/texk/web2c/cwebdir/common.c +++ b/Build/source/texk/web2c/cwebdir/common.c @@ -453,8 +453,8 @@ fatal("! Cannot open output file ",tex_file_name); static boolean input_ln( FILE*fp) { -register int c= EOF; -register char*k; +int c= EOF; +char*k; if(feof(fp))return false; limit= k= buffer; while(k<=buffer_end&&(c= getc(fp))!=EOF&&c!='\n') @@ -1169,7 +1169,7 @@ scan_args(void) { char*dot_pos; char*name_pos; -register char*s; +char*s; boolean found_web= false,found_change= false,found_out= false; diff --git a/Build/source/texk/web2c/cwebdir/common.w b/Build/source/texk/web2c/cwebdir/common.w index 4ec17241c3b..5d7d5f50d01 100644 --- a/Build/source/texk/web2c/cwebdir/common.w +++ b/Build/source/texk/web2c/cwebdir/common.w @@ -157,8 +157,8 @@ support |feof|, |getc|, and |ungetc| you may have to change things here. static boolean input_ln( /* copies a line into |buffer| or returns |false| */ FILE *fp) /* what file to read from */ { - register int c=EOF; /* character read; initialized so some compilers won't complain */ - register char *k; /* where next character goes */ + int c=EOF; /* character read; initialized so some compilers won't complain */ + char *k; /* where next character goes */ if (feof(fp)) return false; /* we have hit end-of-file */ limit = k = buffer; /* beginning of buffer */ while (k<=buffer_end && (c=getc(fp)) != EOF && c!='\n') @@ -1160,7 +1160,7 @@ scan_args(void) { char *dot_pos; /* position of |'.'| in the argument */ char *name_pos; /* file name beginning, sans directory */ - register char *s; /* register for scanning strings */ + char *s; /* pointer for scanning strings */ boolean found_web=false,found_change=false,found_out=false; /* have these names been seen? */ diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch index 94c43c87c8b..5e4fa7c7367 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch @@ -1918,7 +1918,7 @@ It advances |loc| past the title found. @c static sixteen_bits title_lookup(void) { char *first=loc,*last; /* boundaries */ - register name_pointer *p; + name_pointer *p; if (*loc=='"') { while (++loc<=limit && *loc!='"') if (*loc=='\\') loc++; } else if (*loc=='{') { diff --git a/Build/source/texk/web2c/cwebdir/refsort.ch b/Build/source/texk/web2c/cwebdir/refsort.ch index 79a8867b84c..c94722056fd 100644 --- a/Build/source/texk/web2c/cwebdir/refsort.ch +++ b/Build/source/texk/web2c/cwebdir/refsort.ch @@ -27,12 +27,34 @@ main() int main() @z +@x 'register' removed in C++17. + register char *p,*q; + register int n; /* current number of items */ + register item *x, **y; +@y + char *p,*q; + int n; /* current number of items */ + item *x, **y; +@z + @x variable not used { register int k; @y { @z +@x 'register' removed in C++17 +{ register int toggle=0; +@y +{ int toggle=0; +@z + +@x 'register' removed in C++17 +{ register int toggle=0; +@y +{ int toggle=0; +@z + @x add 'Index.' section for (;*p;p++) *q++=*p; } diff --git a/Build/source/texk/web2c/cwebdir/twinx.ch b/Build/source/texk/web2c/cwebdir/twinx.ch index 00513c0c2c6..66e5b969ac3 100644 --- a/Build/source/texk/web2c/cwebdir/twinx.ch +++ b/Build/source/texk/web2c/cwebdir/twinx.ch @@ -60,6 +60,12 @@ turns it into uppercase form. @<Scan file |f|...@>= @z +@x l.56 C++17 removed 'register' storage class. + if (strncmp(buf,"\\def\\title\{",11)==0) {@+register char *p,*q; +@y + if (strncmp(buf,"\\def\\title\{",11)==0) {@+char *p,*q; +@z + @x l.57 FIX: Fetch only the first word from the '\title'. for (p=buf+11,q=title;*p && *p!='}';p++) *q++=*p; @y @@ -92,6 +98,12 @@ char *save_string( char *s) @z +@x l.118 C++17 removed 'register' storage class. + register char *p,*q; register int l; +@y + char *p,*q; int l; +@z + Section 6. @x l.145 @@ -100,6 +112,24 @@ node *new_node() node *new_node(void) @z +@x l.181 C++17 removed 'register' storage class. +register node* main_node; /* current end of main list */ +@y +node* main_node; /* current end of main list */ +@z + +@x l.195 C++17 removed 'register' storage class. +while (1) {@+register node *cur_node; +@y +while (1) {@+node *cur_node; +@z + +@x l.213 C++17 removed 'register' storage class. +{@+register char *p,*q;@+register int bal=1; +@y +{@+char *p,*q;@+int bal=1; +@z + Section 11. @x l.216 FIX: Don't count masked braces. @@ -113,6 +143,23 @@ Section 11. } @z +@x l.289 C++17 removed 'register' storage class. +while (1) {@+register node *p,*q,*r,*s,*t; +@y +while (1) {@+node *p,*q,*r,*s,*t; +@z + +@x l.308 C++17 removed 'register' storage class. +do@+{@+register int d; +@y +do@+{@+int d; +@z + +@x l.323 C++17 removed 'register' storage class. +do@+{@+register int d; +@y +do@+{@+int d; +@z Section 17. @x l.347 @@ -123,8 +170,21 @@ int compare( node *p, node *q) @z + +@x l.349 C++17 removed 'register' storage class. +{@+register unsigned char *pp,*qq; +@y +{@+unsigned char *pp,*qq; +@z + Section 19. +@x l.378 C++17 removed 'register' storage class. +{@+register int j; +@y +{@+int j; +@z + @x l.379 Compiler warning. for (j=1;collate[j];j++) ord[collate[j]]=j; @y @@ -141,12 +201,24 @@ void collapse( node *p, node *q) @z +@x l.392 C++17 removed 'register' storage class. +{@+register node *x; +@y +{@+node *x; +@z + +@x l.403 C++17 removed 'register' storage class. +{@+register node *x; +@y +{@+node *x; +@z + Section 22. @x l.414 Compiler warning. {@+register char *p=x->id; @y -{@+register const char *p=x->id; +{@+const char *p=x->id; @z @x l.434 FIX: Don't mask already masked underscore. @@ -154,3 +226,11 @@ Section 22. @y if (*p=='_'&&*(p-1)!='\\') putchar('\\'); @z + +@x l.441 C++17 removed 'register' storage class. +{@+register node *y=x->data.n,*z=NULL; + while (y) {@+register node *w; +@y +{@+node *y=x->data.n,*z=NULL; + while (y) {@+node *w; +@z |