I'm trying to compile calc on Ubuntu 18.04 using gcc and encountered the following errors:
`~/git/calc$ make all
make[1]: Entering directory '/home/dan/git/calc'
make[1]: Leaving directory '/home/dan/git/calc'
make[1]: Entering directory '/home/dan/git/calc'
gcc -Werror -Wextra -pedantic -DCALC_SRC -DCUSTOM -Wall -fPIC -O3 -g3 -c -o codegen.o codegen.c
codegen.c: In function 'getterm':
codegen.c:2211:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
scanerror(T_NULL,
^~~~~
"Function calls not allowed "
"as expressions");
codegen.c:2214:4: note: here
default:
^~~
codegen.c: In function 'creatematrix':
codegen.c:1396:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
rescantoken();
^~~~~
codegen.c:1397:4: note: here
case T_COMMA:
^~~~
codegen.c:1386:4: error: this statement may fall through [-Werror=implicit-fallthrough=]
rescantoken();
^~~~~
codegen.c:1387:3: note: here
case T_COMMA:
^~~~
codegen.c: In function 'getidexpr':
codegen.c:2248:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (autodef != T_GLOBAL && autodef != T_LOCAL &&
^
codegen.c:2252:2: note: here
default:
^~~
codegen.c:2277:4: error: this statement may fall through [-Werror=implicit-fallthrough=]
scanerror(T_NULL,
^~~~~
"Function calls not allowed "
"as expressions");
codegen.c:2280:3: note: here
default:
^~~
codegen.c: In function 'getstatement':
codegen.c:1023:3: error: this statement may fall through [-Werror=implicit-fallthrough=]
reread();
^~~~
codegen.c:1026:2: note: here
default:
^~~
cc1: all warnings being treated as errors
: recipe for target 'codegen.o' failed
make[1]: *** [codegen.o] Error 1
make[1]: Leaving directory '/home/dan/git/calc'
Makefile:205: recipe for target 'all' failed
make: *** [all] Error 2
`
Any advice on how to proceed?
I'm trying to compile calc on Ubuntu 18.04 using gcc and encountered the following errors:
`~/git/calc$ make all make[1]: Entering directory '/home/dan/git/calc' make[1]: Leaving directory '/home/dan/git/calc' make[1]: Entering directory '/home/dan/git/calc' gcc -Werror -Wextra -pedantic -DCALC_SRC -DCUSTOM -Wall -fPIC -O3 -g3 -c -o codegen.o codegen.c codegen.c: In function 'getterm': codegen.c:2211:5: error: this statement may fall through [-Werror=implicit-fallthrough=] scanerror(T_NULL, ^
~~~~ "Function calls not allowed "codegen.c:2214:4: note: here default: ^
~~ codegen.c: In function 'creatematrix': codegen.c:1396:5: error: this statement may fall through [-Werror=implicit-fallthrough=] rescantoken(); ^~~~~ codegen.c:1397:4: note: here case T_COMMA: ^~~~ codegen.c:1386:4: error: this statement may fall through [-Werror=implicit-fallthrough=] rescantoken(); ^~~~~ codegen.c:1387:3: note: here case T_COMMA: ^~~~ codegen.c: In function 'getidexpr': codegen.c:2248:6: error: this statement may fall through [-Werror=implicit-fallthrough=] if (autodef != T_GLOBAL && autodef != T_LOCAL && ^ codegen.c:2252:2: note: here default: ^~~ codegen.c:2277:4: error: this statement may fall through [-Werror=implicit-fallthrough=] scanerror(T_NULL, ^~~~~ "Function calls not allowed "codegen.c:2280:3: note: here default: ^
~~ codegen.c: In function 'getstatement': codegen.c:1023:3: error: this statement may fall through [-Werror=implicit-fallthrough=] reread(); ^~~~ codegen.c:1026:2: note: here default: ^~~ cc1: all warnings being treated as errors