# HG changeset patch # User Josef 'Jeff' Sipek # Date 1680654543 14400 # Node ID 6075f43a5d72873d7e0cc02a631d532d7ab2460e # Parent 111936b70fccc0e015e21edb9dd8fc33c8060e23 Enable -Wswitch-enum warnings This compiler option enables warnings about switch statements on enums that do not exhaustively list every value. The default case does *not* squelch the warning. Signed-off-by: Josef 'Jeff' Sipek diff -r 111936b70fcc -r 6075f43a5d72 CMakeLists.txt --- a/CMakeLists.txt Sat Jan 14 13:44:43 2023 -0500 +++ b/CMakeLists.txt Tue Apr 04 20:29:03 2023 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2020 Josef 'Jeff' Sipek +# Copyright (c) 2016-2020,2023 Josef 'Jeff' Sipek # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -39,6 +39,7 @@ add_compile_options( -Wall + -Wswitch-enum -O2 -g -std=gnu99 diff -r 111936b70fcc -r 6075f43a5d72 tests/test_sexpr_eval.c --- a/tests/test_sexpr_eval.c Sat Jan 14 13:44:43 2023 -0500 +++ b/tests/test_sexpr_eval.c Tue Apr 04 20:29:03 2023 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 Josef 'Jeff' Sipek + * Copyright (c) 2016-2017,2023 Josef 'Jeff' Sipek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -112,6 +112,14 @@ case VT_INT: ASSERT3U(res->i, ==, expected); break; + case VT_NULL: + case VT_STR: + case VT_SYM: + case VT_CHAR: + case VT_BLOB: + case VT_CONS: + case VT_ARRAY: + case VT_NVL: default: fail("unhandled val type %u", type); } diff -r 111936b70fcc -r 6075f43a5d72 urldecode.c --- a/urldecode.c Sat Jan 14 13:44:43 2023 -0500 +++ b/urldecode.c Tue Apr 04 20:29:03 2023 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2017 Josef 'Jeff' Sipek + * Copyright (c) 2010-2017,2023 Josef 'Jeff' Sipek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -97,6 +97,7 @@ state->outoff++; state->state = DS_COPY; break; + case DS_COPY: default: panic("illegal state when appending an escape"); }