removed needless assertion
This commit is contained in:
parent
cf3d67c529
commit
e480e38ff5
2 changed files with 21 additions and 29 deletions
40
build.ninja
40
build.ninja
|
@ -24,26 +24,6 @@ build $builddir/compile_commands.json: regen_compile_commands ngen.toml || $buil
|
|||
build build.ninja: regen_ninjafile ngen.toml || $builddir/compile_commands.json
|
||||
pool = console
|
||||
|
||||
# BEGIN TARGET debug
|
||||
rule cc_debug
|
||||
deps = gcc
|
||||
depfile = $dep
|
||||
command = cc -I. -fsanitize=address -O0 -g -MD -MF $dep -o $out -c $in
|
||||
description = Building $in -> $out
|
||||
rule link_debug
|
||||
command = cc -fsanitize=address -o $out $in
|
||||
description = Linking $out
|
||||
|
||||
build $builddir/debug/obj: mkdir
|
||||
build $builddir/debug/dep: mkdir
|
||||
|
||||
build $builddir/debug/obj/src-main.c.o: cc_debug src/main.c
|
||||
dep = $builddir/debug/dep/src-main.c.o.d
|
||||
|
||||
build $builddir/debug/pss-total: link_debug $builddir/debug/obj/src-main.c.o | || $builddir/debug/obj $builddir/debug/dep
|
||||
build debug: phony $builddir/debug/pss-total
|
||||
# END TARGET debug
|
||||
|
||||
# BEGIN TARGET release
|
||||
rule cc_release
|
||||
deps = gcc
|
||||
|
@ -83,3 +63,23 @@ build $builddir/main/obj/src-main.c.o: cc_main src/main.c
|
|||
build $builddir/main/pss-total: link_main $builddir/main/obj/src-main.c.o | || $builddir/main/obj $builddir/main/dep
|
||||
build main: phony $builddir/main/pss-total
|
||||
# END TARGET main
|
||||
|
||||
# BEGIN TARGET debug
|
||||
rule cc_debug
|
||||
deps = gcc
|
||||
depfile = $dep
|
||||
command = cc -I. -fsanitize=address -O0 -g -MD -MF $dep -o $out -c $in
|
||||
description = Building $in -> $out
|
||||
rule link_debug
|
||||
command = cc -fsanitize=address -o $out $in
|
||||
description = Linking $out
|
||||
|
||||
build $builddir/debug/obj: mkdir
|
||||
build $builddir/debug/dep: mkdir
|
||||
|
||||
build $builddir/debug/obj/src-main.c.o: cc_debug src/main.c
|
||||
dep = $builddir/debug/dep/src-main.c.o.d
|
||||
|
||||
build $builddir/debug/pss-total: link_debug $builddir/debug/obj/src-main.c.o | || $builddir/debug/obj $builddir/debug/dep
|
||||
build debug: phony $builddir/debug/pss-total
|
||||
# END TARGET debug
|
||||
|
|
10
src/main.c
10
src/main.c
|
@ -22,15 +22,7 @@ double read_file(const char *filename) {
|
|||
fp = fopen(filename, "r");
|
||||
|
||||
if (fp == NULL) {
|
||||
switch (errno) {
|
||||
case EACCES:
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
perror("cannot open file pointer");
|
||||
assert(fp != NULL);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
|
|
Loading…
Reference in a new issue