diff mbox

teach sparse about -m16

Message ID 20180612050236.224-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck June 12, 2018, 5:02 a.m. UTC
The boot part of the kernel on x86-64 has to compile code for
real-mode. This is 32bit code and is specified to GCC with '-m16'.

However, sparse hadn't knwoledge of this flag and thus uses the
default LP64 model for it which, of course, can cause false
warnings because of the mismatched sizes.

Fix this by teaching sparse about the -m16 flag by treating it
the same as -m32.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/lib.c b/lib.c
index 28eefc29a..aeef312df 100644
--- a/lib.c
+++ b/lib.c
@@ -454,7 +454,7 @@  static char **handle_switch_m(char *arg, char **next)
 {
 	if (!strcmp(arg, "m64")) {
 		arch_m64 = ARCH_LP64;
-	} else if (!strcmp(arg, "m32")) {
+	} else if (!strcmp(arg, "m32") || !strcmp(arg, "m16")) {
 		arch_m64 = ARCH_LP32;
 	} else if (!strcmp(arg, "mx32")) {
 		arch_m64 = ARCH_X32;