🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1156

Possible stdarg.h bug on Mips Ultrix?

#1156
From: meissner
Date: Tue, 15 Sep 1992 14:33
31 lines
1499 bytes
| In gcc 2.2.2, stdarg.h includes va-mips.h, which says
| 
|     #define va_arg(AP, mode)						\
|       ((mode *)(AP = (char *) (__alignof(mode) > 4			\
| 				    ? ((int)AP + 2*8 - 1) & -8		\
| 				    : ((int)AP + 2*4 - 1) & -4)))[-1]
| 
| 
| (if !lint).  However, under Ultrix V4.2A (Rev. 47) running on a
| DecStation, I find the following:
| 
|     #ifdef __host_mips
| 
|      ...
| 
| 	    /* va_arg aligns list and points past data */
|     #define va_arg(list, mode) ((mode *)(list =\
|      (va_list) ((((int)list + (__builtin_alignof(mode)<=4?3:7)) &\
|      (__builtin_alignof(mode)<=4?-4:-8))+sizeof(mode))))[-1]
| 
| Notice that the va-mips.h code is insensitive to sizeof(mode).  As a
| result, passing of sufficiently large structures does not work.  What
| is going on?

Fixed in GCC 2.3.

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
Technical Details
Message-ID: <9209152233.AA30339@curley.osf.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
References: meissner@osf.ORG

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
From: meissner@osf.ORG
Subject: Possible stdarg.h bug on Mips Ultrix?
Message-ID: <9209152233.AA30339@curley.osf.org>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: meissner@osf.ORG
Distribution: gnu
Date: Tue, 15 Sep 1992 14:33:50 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 32