From 619eac2721423d09de3fe36a8ba51e26776740af Mon Sep 17 00:00:00 2001 From: Avril Date: Tue, 18 May 2021 21:02:19 +0100 Subject: [PATCH] read error reporting --- Makefile | 3 ++- src/bits.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ab29b1b..6bf6a57 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ INCLUDE=include COMMON_FLAGS= -W -Wall -pedantic -fno-strict-aliasing $(addprefix -I,$(INCLUDE)) -OPT_FLAGS?= -march=native -fgraphite -fopenmp -floop-parallelize-all -ftree-parallelize-loops=4 \ +MARCH?= -march=native +OPT_FLAGS?= $(MARCH) -fgraphite -fopenmp -floop-parallelize-all -ftree-parallelize-loops=4 \ -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block \ -fno-stack-check diff --git a/src/bits.c b/src/bits.c index 6186ab5..6305b80 100644 --- a/src/bits.c +++ b/src/bits.c @@ -13,7 +13,7 @@ static inline int sfread(void* out, size_t *restrict size, FILE* f) { register ssize_t r = fread(out, 1, *size, f); - return r < 0 ? 0 : !!(*size = (size_t)r); + return r < 0 ? (perror("failed to read from stdin"), 0) : !!(*size = (size_t)r); } static int fwrite_all(const void* _buf, size_t sz, size_t num, FILE* out)