texlive[62584] Build/source/texk/web2c: [CWEB] Make 'fall thru'
commits+ascherer at tug.org
commits+ascherer at tug.org
Thu Mar 10 11:50:21 CET 2022
Revision: 62584
http://tug.org/svn/texlive?view=revision&revision=62584
Author: ascherer
Date: 2022-03-10 11:50:21 +0100 (Thu, 10 Mar 2022)
Log Message:
-----------
[CWEB] Make 'fall thru' comments active.
This is specific for GCC, but totally harmless for any other C compiler:
GCC accepts 'fall thru' comments from the CWEB sources with its option
'-Wimplicit-fallthrough=2', when we push these comments over to the
tangled C code.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/ChangeLog
trunk/Build/source/texk/web2c/ctangleboot.cin
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/Makefile
trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/ctangle.c
trunk/Build/source/texk/web2c/cwebdir/ctangle.w
trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweave.w
Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/ChangeLog 2022-03-10 10:50:21 UTC (rev 62584)
@@ -1,3 +1,7 @@
+2022-03-10 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin: Make 'fall thru' comments active.
+
2022-03-03 Andreas Scherer <https://ascherer.github.io>
* cpascal.h,
Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin 2022-03-10 10:50:21 UTC (rev 62584)
@@ -274,7 +274,7 @@
extern FILE*check_file;
/*:15*//*116:*/
-#line 504 "cwebdir/ctang-w2c.ch"
+#line 506 "cwebdir/ctang-w2c.ch"
extern char cb_banner[];
@@ -540,7 +540,7 @@
section_text[0]= ' ';
/*:78*//*117:*/
-#line 507 "cwebdir/ctang-w2c.ch"
+#line 509 "cwebdir/ctang-w2c.ch"
strncpy(cb_banner,banner,max_banner-1);
@@ -754,11 +754,11 @@
if(check_for_change){
fclose(C_file);C_file= NULL;
/*106:*/
-#line 387 "cwebdir/ctang-w2c.ch"
+#line 389 "cwebdir/ctang-w2c.ch"
if((C_file= fopen(C_file_name,"r"))!=NULL){
/*107:*/
-#line 394 "cwebdir/ctang-w2c.ch"
+#line 396 "cwebdir/ctang-w2c.ch"
boolean comparison= false;
@@ -767,7 +767,7 @@
/*108:*/
-#line 408 "cwebdir/ctang-w2c.ch"
+#line 410 "cwebdir/ctang-w2c.ch"
do{
char x[BUFSIZ],y[BUFSIZ];
@@ -777,7 +777,7 @@
}while(comparison&&!feof(C_file)&&!feof(check_file));
/*:108*/
-#line 401 "cwebdir/ctang-w2c.ch"
+#line 403 "cwebdir/ctang-w2c.ch"
fclose(C_file);C_file= NULL;
@@ -784,10 +784,10 @@
fclose(check_file);check_file= NULL;
/*:107*/
-#line 389 "cwebdir/ctang-w2c.ch"
+#line 391 "cwebdir/ctang-w2c.ch"
/*109:*/
-#line 419 "cwebdir/ctang-w2c.ch"
+#line 421 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -797,7 +797,7 @@
}
/*:109*/
-#line 390 "cwebdir/ctang-w2c.ch"
+#line 392 "cwebdir/ctang-w2c.ch"
}else
rename(check_file_name,C_file_name);
@@ -810,7 +810,7 @@
an_output_file--;
sprint_section_name(output_file_name,*an_output_file);
if(check_for_change)/*105:*/
-#line 378 "cwebdir/ctang-w2c.ch"
+#line 380 "cwebdir/ctang-w2c.ch"
{
if((C_file= fopen(output_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),output_file_name);
@@ -841,14 +841,14 @@
if(check_for_change){
fclose(C_file);C_file= NULL;
/*110:*/
-#line 432 "cwebdir/ctang-w2c.ch"
+#line 434 "cwebdir/ctang-w2c.ch"
if(0==strcmp("/dev/stdout",output_file_name))
/*112:*/
-#line 459 "cwebdir/ctang-w2c.ch"
+#line 461 "cwebdir/ctang-w2c.ch"
{
/*115:*/
-#line 490 "cwebdir/ctang-w2c.ch"
+#line 492 "cwebdir/ctang-w2c.ch"
char in_buf[BUFSIZ+1];
int in_size;
@@ -858,7 +858,7 @@
/*:115*/
-#line 460 "cwebdir/ctang-w2c.ch"
+#line 462 "cwebdir/ctang-w2c.ch"
do{
in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -867,7 +867,7 @@
}while(!feof(check_file));
fclose(check_file);check_file= NULL;
/*111:*/
-#line 449 "cwebdir/ctang-w2c.ch"
+#line 451 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -877,19 +877,19 @@
}
/*:111*/
-#line 467 "cwebdir/ctang-w2c.ch"
+#line 469 "cwebdir/ctang-w2c.ch"
}
/*:112*/
-#line 434 "cwebdir/ctang-w2c.ch"
+#line 436 "cwebdir/ctang-w2c.ch"
else if(0==strcmp("/dev/stderr",output_file_name))
/*113:*/
-#line 472 "cwebdir/ctang-w2c.ch"
+#line 474 "cwebdir/ctang-w2c.ch"
{
/*115:*/
-#line 490 "cwebdir/ctang-w2c.ch"
+#line 492 "cwebdir/ctang-w2c.ch"
char in_buf[BUFSIZ+1];
int in_size;
@@ -899,7 +899,7 @@
/*:115*/
-#line 473 "cwebdir/ctang-w2c.ch"
+#line 475 "cwebdir/ctang-w2c.ch"
do{
in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -908,7 +908,7 @@
}while(!feof(check_file));
fclose(check_file);check_file= NULL;
/*111:*/
-#line 449 "cwebdir/ctang-w2c.ch"
+#line 451 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -918,20 +918,20 @@
}
/*:111*/
-#line 480 "cwebdir/ctang-w2c.ch"
+#line 482 "cwebdir/ctang-w2c.ch"
}
/*:113*/
-#line 436 "cwebdir/ctang-w2c.ch"
+#line 438 "cwebdir/ctang-w2c.ch"
else if(0==strcmp("/dev/null",output_file_name))
/*114:*/
-#line 485 "cwebdir/ctang-w2c.ch"
+#line 487 "cwebdir/ctang-w2c.ch"
{
boolean comparison= true;
/*111:*/
-#line 449 "cwebdir/ctang-w2c.ch"
+#line 451 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -941,17 +941,17 @@
}
/*:111*/
-#line 487 "cwebdir/ctang-w2c.ch"
+#line 489 "cwebdir/ctang-w2c.ch"
}
/*:114*/
-#line 438 "cwebdir/ctang-w2c.ch"
+#line 440 "cwebdir/ctang-w2c.ch"
else{
if((C_file= fopen(output_file_name,"r"))!=NULL){
/*107:*/
-#line 394 "cwebdir/ctang-w2c.ch"
+#line 396 "cwebdir/ctang-w2c.ch"
boolean comparison= false;
@@ -960,7 +960,7 @@
/*108:*/
-#line 408 "cwebdir/ctang-w2c.ch"
+#line 410 "cwebdir/ctang-w2c.ch"
do{
char x[BUFSIZ],y[BUFSIZ];
@@ -970,7 +970,7 @@
}while(comparison&&!feof(C_file)&&!feof(check_file));
/*:108*/
-#line 401 "cwebdir/ctang-w2c.ch"
+#line 403 "cwebdir/ctang-w2c.ch"
fclose(C_file);C_file= NULL;
@@ -977,10 +977,10 @@
fclose(check_file);check_file= NULL;
/*:107*/
-#line 441 "cwebdir/ctang-w2c.ch"
+#line 443 "cwebdir/ctang-w2c.ch"
/*111:*/
-#line 449 "cwebdir/ctang-w2c.ch"
+#line 451 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -990,7 +990,7 @@
}
/*:111*/
-#line 442 "cwebdir/ctang-w2c.ch"
+#line 444 "cwebdir/ctang-w2c.ch"
}else
rename(check_file_name,output_file_name);
@@ -1153,7 +1153,7 @@
else out_state= verbatim;break;
case'/':C_putc('/');out_state= post_slash;break;
case'*':if(out_state==post_slash)C_putc(' ');
-
+/* fall through */
default:C_putc(cur_char);out_state= normal;break;
}
}
@@ -1930,7 +1930,7 @@
loc+= 3;
if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
-#line 330 "cwebdir/ctang-w2c.ch"
+#line 332 "cwebdir/ctang-w2c.ch"
err_print(_("! Improper hex number following @l"));
#line 1529 "cwebdir/ctangle.w"
@@ -1942,7 +1942,7 @@
beg= loc;
while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++;
if(loc-beg>=translit_length)
-#line 336 "cwebdir/ctang-w2c.ch"
+#line 338 "cwebdir/ctang-w2c.ch"
err_print(_("! Replacement string in @l too long"));
#line 1539 "cwebdir/ctangle.w"
@@ -1964,8 +1964,8 @@
#line 1511 "cwebdir/ctangle.w"
break;
-}
-#line 324 "cwebdir/ctang-w2c.ch"
+#line 325 "cwebdir/ctang-w2c.ch"
+}/* otherwise fall through */
default:err_print(_("! Double @ should be used in limbo"));
#line 1515 "cwebdir/ctangle.w"
@@ -1979,7 +1979,7 @@
void
print_stats(void){
-#line 349 "cwebdir/ctang-w2c.ch"
+#line 351 "cwebdir/ctang-w2c.ch"
puts(_("\nMemory usage statistics:"));
printf(_("%td names (out of %ld)\n"),
(ptrdiff_t)(name_ptr-name_dir),(long)max_names);
@@ -1992,5 +1992,5 @@
(ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks);
}
-#line 362 "cwebdir/ctang-w2c.ch"
+#line 364 "cwebdir/ctang-w2c.ch"
/*:103*/
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2022-03-10 10:50:21 UTC (rev 62584)
@@ -1,3 +1,14 @@
+2022-03-10 Andreas Scherer <https://ascherer.github.io>
+
+ * Makefile,
+ * ctang-w2c.ch,
+ * ctangle.c,
+ * ctangle.w,
+ * ctwill-mini.ch,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch,
+ * cweave.w: Make 'fall thru' comments active.
+
2022-02-18 Andreas Scherer <https://ascherer.github.io>
* common.c,
Modified: trunk/Build/source/texk/web2c/cwebdir/Makefile
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/Makefile 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/Makefile 2022-03-10 10:50:21 UTC (rev 62584)
@@ -50,7 +50,7 @@
WCHANGES=
# We keep debugging info around, for fun, but most users don't need it
-CFLAGS = -g
+CFLAGS = -g # -Wall -Wextra -Wimplicit-fallthrough=2 # check compiler warnings
#CFLAGS = -O
LINKFLAGS = -g
#LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
Modified: trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch 2022-03-10 10:50:21 UTC (rev 62584)
@@ -319,8 +319,10 @@
@z
@x
+ } @=/* otherwise fall through */@>
default: err_print("! Double @@ should be used in limbo");
@y
+ } @=/* otherwise fall through */@>
default: err_print(_("! Double @@ should be used in limbo"));
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.c 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.c 2022-03-10 10:50:21 UTC (rev 62584)
@@ -866,7 +866,7 @@
else out_state= verbatim;break;
case'/':C_putc('/');out_state= post_slash;break;
case'*':if(out_state==post_slash)C_putc(' ');
-
+/* fall through */
default:C_putc(cur_char);out_state= normal;break;
}
}
@@ -1627,7 +1627,7 @@
err_print("! Double @ should be used in control text");
break;
-}
+}/* otherwise fall through */
default:err_print("! Double @ should be used in limbo");
}
Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.w 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.w 2022-03-10 10:50:21 UTC (rev 62584)
@@ -666,7 +666,7 @@
else out_state=verbatim; break;
case '/': C_putc('/'); out_state=post_slash; break;
case '*': if (out_state==post_slash) C_putc(' ');
- /* fall through */
+ @=/* fall through */@>
default: C_putc(cur_char); out_state=normal; break;
}
}
@@ -1510,7 +1510,7 @@
err_print("! Double @@ should be used in control text");
@.Double @@ should be used...@>
break;
- } /* otherwise fall through */
+ } @=/* otherwise fall through */@>
default: err_print("! Double @@ should be used in limbo");
@.Double @@ should be used...@>
}
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2022-03-10 10:50:21 UTC (rev 62584)
@@ -1556,7 +1556,7 @@
case end_translation: return;
case identifier: case res_word: @<Output an identifier@>@; break;
case section_code: @<Output a section name@>@; break;
- case math_rel: out_str("\\MRL{"@q}@>); /* fall through */
+ case math_rel: out_str("\\MRL{"@q}@>); @=/* fall through */@>
@.\\MRL@>
case noop: case inserted: break;
case cancel: case big_cancel: c=0; b=a;
@@ -1578,11 +1578,11 @@
if (a!=big_force) {
out_str("\\1\\1"); goto reswitch;
}
- else dindent_pending=true; /* fall through */
+ else dindent_pending=true; @=/* fall through */@>
case indent: case outdent: case opt: case backup: case break_space:
case force: case big_force: case preproc_line: @<Output a control,
look ahead in case of line breaks, possibly |goto reswitch|@>@; break;
- case quoted_char: out(*(cur_tok++)); /* fall through */
+ case quoted_char: out(*(cur_tok++)); @=/* fall through */@>
case qualifier: break;
default: out(a); /* otherwise |a| is an ordinary character */
}
@@ -1598,7 +1598,7 @@
case end_translation: return;
case identifier: case res_word: @<Output an identifier@>@; break;
case section_code: @<Output a section name@>@; break;
- case math_rel: out_str("\\MRL{"@q}@>); /* fall through */
+ case math_rel: out_str("\\MRL{"@q}@>); @=/* fall through */@>
@.\\MRL@>
case noop: case inserted: break;
case cancel: case big_cancel: c=0; b=a;
@@ -1620,11 +1620,11 @@
if (a!=big_force) {
out_str("\\1\\1"); goto reswitch;
}
- else dindent_pending=true; /* fall through */
+ else dindent_pending=true; @=/* fall through */@>
case indent: case outdent: case opt: case backup: case break_space:
case force: case big_force: case preproc_line: @<Output a control,
look ahead in case of line breaks, possibly |goto reswitch|@>@; break;
- case quoted_char: out(*(cur_tok++)); /* fall through */
+ case quoted_char: out(*(cur_tok++)); @=/* fall through */@>
case qualifier: break;
default: out(a); /* otherwise |a| is an ordinary character */
}
@@ -1673,12 +1673,12 @@
@x
case ' ': case '\\': case '#': case '%': case '$': case '^':
case '{': case '}': case '~': case '&': case '_':
- out('\\'); /* falls through */
+ out('\\'); @=/* falls through */@>
@y
case ' ': case '\\': case '#': case '%': @/
case '$': case '^': case '{': case '}': @/
case '~': case '&': case '_': @/
- out('\\'); /* falls through */
+ out('\\'); @=/* falls through */@>
@z
Section 242.
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2022-03-10 10:50:21 UTC (rev 62584)
@@ -1099,8 +1099,10 @@
@z
@x
+ } @=/* otherwise fall through */@>
default: err_print("! Improper macro definition"); break;
@y
+ } @=/* otherwise fall through */@>
default: err_print(_("! Improper macro definition")); break;
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2022-03-10 10:50:21 UTC (rev 62584)
@@ -523,8 +523,10 @@
@z
@x
+ } @=/* otherwise fall through */@>
default: err_print("! Improper macro definition"); break;
@y
+ } @=/* otherwise fall through */@>
default: err_print(_("! Improper macro definition")); break;
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w 2022-03-10 09:33:53 UTC (rev 62583)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w 2022-03-10 10:50:21 UTC (rev 62584)
@@ -948,7 +948,7 @@
case verbatim: @<Scan a verbatim string@>@;
case ord: @<Get a string@>@;
case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
- case TeX_string: skip_restricted(); /* fall through */
+ case TeX_string: skip_restricted(); @=/* fall through */@>
default: return ccode[c];
}
@@ -2535,10 +2535,12 @@
if (name_dir[r].ilk==case_like) return case_found;
if (name_dir[r].ilk==operator_like) return operator_found;
if (name_dir[r].ilk!=raw_int) break;
+ @=/* else fall through */@>
case 1: return j;
case 4: case 5: /* |tok_flag| or |inner_tok_flag| */
if ((q=find_first_ident(tok_start+r))!=no_ident_found)
return q;
+ @=/* else fall through */@>
default: ; /* char, |section_flag|, fall thru: move on to next token */
if (*j==inserted) return no_ident_found; /* ignore inserts */
else if (*j==qualifier) j++; /* bypass namespace qualifier */
@@ -3919,7 +3921,7 @@
case end_translation: return;
case identifier: case res_word: @<Output an identifier@>@; break;
case section_code: @<Output a section name@>@; break;
- case math_rel: out_str("\\MRL{"@q}@>); /* fall through */
+ case math_rel: out_str("\\MRL{"@q}@>); @=/* fall through */@>
@.\\MRL@>
case noop: case inserted: break;
case cancel: case big_cancel: c=0; b=a;
@@ -3941,11 +3943,11 @@
if (a!=big_force) {
out_str("\\1\\1"); goto reswitch;
}
- else dindent_pending=true; /* fall through */
+ else dindent_pending=true; @=/* fall through */@>
case indent: case outdent: case opt: case backup: case break_space:
case force: case big_force: case preproc_line: @<Output a control,
look ahead in case of line breaks, possibly |goto reswitch|@>@; break;
- case quoted_char: out(*(cur_tok++)); /* fall through */
+ case quoted_char: out(*(cur_tok++)); @=/* fall through */@>
case qualifier: break;
default: out(a); /* otherwise |a| is an ordinary character */
}
@@ -4100,7 +4102,7 @@
switch (b) {
case ' ': case '\\': case '#': case '%': case '$': case '^':
case '{': case '}': case '~': case '&': case '_':
- out('\\'); /* falls through */
+ out('\\'); @=/* falls through */@>
@.\\\ @>
@.\\\\@>
@.\\\#@>
@@ -4353,7 +4355,7 @@
app_scrap(raw_int,no_math);
if ((next_control=get_next())==')') {
app(next_control); next_control=get_next(); break;
- } /* otherwise fall through */
+ } @=/* otherwise fall through */@>
default: err_print("! Improper macro definition"); break;
}
app('$');
@@ -4786,6 +4788,7 @@
case wildcard: out_str("\\9");@+ goto not_an_identifier;
@.\\9@>
case typewriter: out_str("\\.");
+ @=/* fall through */@>
@.\\.@>
case roman: not_an_identifier: out_name(cur_name,false); goto name_done;
case custom:
More information about the tex-live-commits
mailing list.