From 26b1e49ee35c0656c092ac2c7fa7dd0d2c8df5cf Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 20 Jun 2021 14:11:33 -0700 Subject: [PATCH] swap assertion in setattr for a call to UNREACHABLE This removes some -Wstring-conversion warnings when building with Clang, due to the expression `!"unreachable"`. It also teaches the compiler it can more aggressively optimize this switch. --- lib/cgraph/attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cgraph/attr.c b/lib/cgraph/attr.c index 7a8ce5aea..2e09f873b 100644 --- a/lib/cgraph/attr.c +++ b/lib/cgraph/attr.c @@ -9,6 +9,7 @@ *************************************************************************/ #include +#include #include /* @@ -292,8 +293,7 @@ static Agsym_t *setattr(Agraph_t * g, int kind, char *name, char *value) addattr(g, (Agobj_t *) e, rsym); break; default: - assert(!"unreachable"); - break; + UNREACHABLE(); } rv = rsym; } -- 2.40.0