diff mbox series

[1/7] simplify initialization of Wdeclarationafterstatement

Message ID 20191128204225.7002-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series add support for '-std=c17' | expand

Commit Message

Luc Van Oostenryck Nov. 28, 2019, 8:42 p.m. UTC
In preparation for supporting C17 flags, remove unneeded
STANDARD_... cases and remove the impossible default assert(0).

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/lib.c b/lib.c
index f0b546889..7866800bf 100644
--- a/lib.c
+++ b/lib.c
@@ -890,27 +890,16 @@  static void handle_switch_W_finalize(void)
 	handle_onoff_switch_finalize(warnings, ARRAY_SIZE(warnings));
 
 	/* default Wdeclarationafterstatement based on the C dialect */
-	if (-1 == Wdeclarationafterstatement)
-	{
-		switch (standard)
-		{
+	if (-1 == Wdeclarationafterstatement) {
+		switch (standard) {
 			case STANDARD_C89:
 			case STANDARD_C94:
 				Wdeclarationafterstatement = 1;
 				break;
-
-			case STANDARD_C99:
-			case STANDARD_GNU89:
-			case STANDARD_GNU99:
-			case STANDARD_C11:
-			case STANDARD_GNU11:
+			default:
 				Wdeclarationafterstatement = 0;
 				break;
-
-			default:
-				assert (0);
 		}
-
 	}
 }