[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sparse
Subject:    [PATCH 4/7] reorganize the __STDC_VERSION__/__STRICT_ANSI__ switch statement
From:       Luc Van Oostenryck <luc.vanoostenryck () gmail ! com>
Date:       2019-11-28 20:42:22
Message-ID: 20191128204225.7002-5-luc.vanoostenryck () gmail ! com
[Download RAW message or body]

Move some of the cases so that each STANDARD_GNU* is just
under the its corresponding STANDRAD_C*.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/lib.c b/lib.c
index 97d8af390..02f6231e2 100644
--- a/lib.c
+++ b/lib.c
@@ -1405,24 +1405,21 @@ static void predefined_macros(void)
 
 	predefine("__STDC__", 1, "1");
 	switch (standard) {
+	default:
+		break;
+
 	case STANDARD_C89:
 		predefine("__STRICT_ANSI__", 1, "1");
+	case STANDARD_GNU89:
 		break;
 
 	case STANDARD_C94:
-		predefine("__STDC_VERSION__", 1, "199409L");
 		predefine("__STRICT_ANSI__", 1, "1");
+		predefine("__STDC_VERSION__", 1, "199409L");
 		break;
 
 	case STANDARD_C99:
-		predefine("__STDC_VERSION__", 1, "199901L");
 		predefine("__STRICT_ANSI__", 1, "1");
-		break;
-
-	case STANDARD_GNU89:
-	default:
-		break;
-
 	case STANDARD_GNU99:
 		predefine("__STDC_VERSION__", 1, "199901L");
 		break;
-- 
2.24.0

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic