[PATCH] teach sparse about -m16

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

 



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@xxxxxxxxx>
---
 lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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