Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2002 15:57:28 +0200
From:      Poul-Henning Kamp <phk@freebsd.org>
To:        current@freebsd.org
Subject:   GCC 3.1 generates bounds traps for bogous va_arg() use...
Message-ID:  <15004.1021298248@critter.freebsd.dk>

next in thread | raw e-mail | index | archive | help
GCC 3.1 whines about these two instances of va_arg() and generates
code which calls "int 5" if they are executed.

This workaround works for me, but I don't know if this is the
correct fix so I won't commit it.

In light of this, we may want to change the kernels panic message
for these traps to be more informative.

Poul-Henning

Index: bios.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/bios.c,v
retrieving revision 1.52
diff -u -r1.52 bios.c
--- bios.c	17 Apr 2002 13:06:35 -0000	1.52
+++ bios.c	13 May 2002 13:53:27 -0000
@@ -363,7 +363,11 @@
 	    break;
 	    
 	case 's':			/* 16-bit integer */
+#if 0
 	    i = va_arg(ap, u_short);
+#else
+	    i = va_arg(ap, u_int);
+#endif
 	    stack -= 2;
 	    break;
 
@@ -435,7 +439,11 @@
 	    break;
 
 	case 's':			/* 16-bit integer */
+#if 0
 	    i = va_arg(ap, u_short);
+#else
+	    i = va_arg(ap, u_int);
+#endif
 	    *(u_short *)stack = i;
 	    stack += 2;
 	    break;

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15004.1021298248>