From 9ebb039a81f5ea06e97d84ef7ee447da9dfca204 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 29 Oct 2024 23:14:31 -0400 Subject: Fix up some GCC compiler flag options for LTO and inlining --- types.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'types.c') diff --git a/types.c b/types.c index 1a140a32..bcb0e9f3 100644 --- a/types.c +++ b/types.c @@ -161,7 +161,7 @@ type_t *type_or_type(type_t *a, type_t *b) return NULL; } -static PUREFUNC inline double type_min_magnitude(type_t *t) +static PUREFUNC INLINE double type_min_magnitude(type_t *t) { switch (t->tag) { case BoolType: return (double)false; @@ -181,7 +181,7 @@ static PUREFUNC inline double type_min_magnitude(type_t *t) } } -static PUREFUNC inline double type_max_magnitude(type_t *t) +static PUREFUNC INLINE double type_max_magnitude(type_t *t) { switch (t->tag) { case BoolType: return (double)true; @@ -417,6 +417,7 @@ PUREFUNC size_t unpadded_struct_size(type_t *t) PUREFUNC size_t type_size(type_t *t) { +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" switch (t->tag) { case UnknownType: case AbortType: case ReturnType: case VoidType: return 0; @@ -494,11 +495,14 @@ PUREFUNC size_t type_size(type_t *t) case TypeInfoType: return sizeof(TypeInfo_t); case ModuleType: return 0; } +#pragma GCC diagnostic pop errx(1, "This should not be reachable"); } PUREFUNC size_t type_align(type_t *t) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wswitch-default" switch (t->tag) { case UnknownType: case AbortType: case ReturnType: case VoidType: return 0; case MemoryType: errx(1, "Memory has undefined type alignment"); @@ -560,6 +564,7 @@ PUREFUNC size_t type_align(type_t *t) case TypeInfoType: return __alignof__(TypeInfo_t); case ModuleType: return 0; } +#pragma GCC diagnostic pop errx(1, "This should not be reachable"); } -- cgit v1.2.3