shithub: scc

Download patch

ref: a673d0b0fe5be7a502cf309be5d95c462adbad50
parent: c5134537d2d2b0a7b7b2e9a08e5255c4b881cdbb
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Mar 28 11:42:02 EDT 2022

cc1: Use void as base type of void poinetrs

Void pointers were using char as base type and it was confusing the
function eqtype() which was declaring that char pointers and void
pointers were the same type.

--- a/src/cmd/cc/cc1/amd64-sysv.c
+++ b/src/cmd/cc/cc1/amd64-sysv.c
@@ -198,7 +198,7 @@
 
 	sizettype = &arch.sizettype;
 	arch.va_list_type = *mktype(&arch.va_type, ARY, 1, NULL);
-	arch.pvoidtype.type = &arch.chartype;
+	arch.pvoidtype.type = &arch.voidtype;
 	arch.valid_va_list = local_valid_va_list;
 
 	return &arch;
--- a/src/cmd/cc/cc1/arm64-sysv.c
+++ b/src/cmd/cc/cc1/arm64-sysv.c
@@ -198,7 +198,7 @@
 
 	sizettype = &arch.sizettype;
 	arch.va_list_type = *mktype(&arch.va_type, ARY, 1, NULL);
-	arch.pvoidtype.type = &arch.chartype;
+	arch.pvoidtype.type = &arch.voidtype;
 	arch.valid_va_list = local_valid_va_list;
 	arch.zero.type = inttype;
 	arch.one.type = inttype;
--- a/src/cmd/cc/cc1/i386-sysv.c
+++ b/src/cmd/cc/cc1/i386-sysv.c
@@ -204,7 +204,7 @@
 	};
 
 	arch.valid_va_list = local_valid_va_list;
-	arch.pvoidtype.type = &arch.chartype;
+	arch.pvoidtype.type = &arch.voidtype;
 	arch.va_list_type.type = &arch.longtype;
 
 	return &arch;
--- a/src/cmd/cc/cc1/z80-scc.c
+++ b/src/cmd/cc/cc1/z80-scc.c
@@ -203,7 +203,7 @@
 		},
 	};
 	arch.valid_va_list = local_valid_va_list;
-	arch.pvoidtype.type = &arch.chartype;
+	arch.pvoidtype.type = &arch.voidtype;
 	arch.va_type.type = &arch.inttype;
 
 	return &arch;
--- a/tests/cc/execute/scc-tests.lst
+++ b/tests/cc/execute/scc-tests.lst
@@ -189,7 +189,7 @@
 0196-invalidchar.c
 0197-cppcomment.c
 0198-nullcpp.c
-0199-voidpcast.c [TODO]
+0199-voidpcast.c
 0200-cpp.c [TODO]
 0201-cpp.c [TODO]
 0202-variadic.c [TODO]