summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/lib/numeric.h13
-rw-r--r--defaults.mk2
2 files changed, 8 insertions, 7 deletions
diff --git a/api/lib/numeric.h b/api/lib/numeric.h
index db6c777..2b724e0 100644
--- a/api/lib/numeric.h
+++ b/api/lib/numeric.h
@@ -1,16 +1,17 @@
#pragma once
+#pragma GCC diagnostic ignored "-Wgnu-statement-expression"
#define min(x, y) \
({ \
- typeof (x) _x = (x); \
- typeof (y) _y = (y); \
- _x > _y ? _x : _y; \
+ __typeof__ (x) _x = (x); \
+ __typeof__ (y) _y = (y); \
+ _x < _y ? _x : _y; \
})
#define max(x, y) \
({ \
- typeof (x) _x = (x); \
- typeof (y) _y = (y); \
- _x < _y ? _x : _y; \
+ __typeof__ (x) _x = (x); \
+ __typeof__ (y) _y = (y); \
+ _x > _y ? _x : _y; \
})
diff --git a/defaults.mk b/defaults.mk
index 2cc7ac1..73e8950 100644
--- a/defaults.mk
+++ b/defaults.mk
@@ -11,7 +11,7 @@ OBJCOPY := objcopy
CFLAGS += -ffreestanding -mno-red-zone -ggdb -std=c2x \
-Wall -Wextra -Werror -fno-stack-protector \
- -Wpedantic
+ -Wpedantic -std=c2x
CXXFLAGS += -ffreestanding -mno-red-zone -ggdb \
-Wall -Wextra -Werror -fno-stack-protector