From owner-freebsd-current Mon May 13 6:58:30 2002 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id E853837B401 for ; Mon, 13 May 2002 06:58:07 -0700 (PDT) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.2/8.12.2) with ESMTP id g4DDvSHA015005 for ; Mon, 13 May 2002 15:57:29 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: current@freebsd.org Subject: GCC 3.1 generates bounds traps for bogous va_arg() use... From: Poul-Henning Kamp Date: Mon, 13 May 2002 15:57:28 +0200 Message-ID: <15004.1021298248@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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