[PATCH 1/7] simplify initialization of Wdeclarationafterstatement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 lib.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

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);
 		}
-
 	}
 }
 
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux