From owner-freebsd-hackers Sun May 19 5:24:41 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.jeamland.net (rafe.jeamland.net [203.18.243.114]) by hub.freebsd.org (Postfix) with ESMTP id 35E4737B408 for ; Sun, 19 May 2002 05:24:31 -0700 (PDT) Received: from ratchet.int.jeamland.net (ratchet.jeamland.net [210.15.217.227]) by mail.jeamland.net (Postfix) with ESMTP id DCE4D7060A for ; Sun, 19 May 2002 22:24:15 +1000 (EST) Subject: va_copy in libc From: Benno Rice To: hackers@freebsd.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-wK0BUqTBcgONhCjn2Dgx" X-Mailer: Ximian Evolution 1.0.5 Date: 19 May 2002 22:24:14 +1000 Message-Id: <1021811056.574.6.camel@ratchet.jeamland.net> Mime-Version: 1.0 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-wK0BUqTBcgONhCjn2Dgx Content-Type: multipart/mixed; boundary="=-wFCIaByvzCHiT+6uST6j" --=-wFCIaByvzCHiT+6uST6j Content-Type: text/plain Content-Transfer-Encoding: quoted-printable While trying to build libc for PowerPC, I ran into the problem that for some reason gcc gave me this: /home/benno/powerpc/lib/libc/stdio/vfprintf.c:551: incompatible types in assignment For the this: int __vfprintf(FILE *fp, const char *fmt0, va_list ap) { ... va_list orgap; /* original argument pointer */ ... orgap =3D ap; Replacing the orgap =3D ap with va_copy(orgap, ap) (as in the attached diff) makes the problem go away. Does anyone mind if I commit this? --=20 Benno Rice benno@FreeBSD.org --=-wFCIaByvzCHiT+6uST6j Content-Disposition: attachment; filename=vfprintf.diff Content-Type: text/x-patch; name=vfprintf.diff; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Index: lib/libc/stdio/vfprintf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/lib/libc/stdio/vfprintf.c,v retrieving revision 1.40 diff -u -r1.40 vfprintf.c --- lib/libc/stdio/vfprintf.c 22 Mar 2002 21:53:04 -0000 1.40 +++ lib/libc/stdio/vfprintf.c 19 May 2002 12:15:05 -0000 @@ -548,7 +548,7 @@ fmt =3D (char *)fmt0; argtable =3D NULL; nextarg =3D 1; - orgap =3D ap; + va_copy(orgap, ap); uio.uio_iov =3D iovp =3D iov; uio.uio_resid =3D 0; uio.uio_iovcnt =3D 0; --=-wFCIaByvzCHiT+6uST6j-- --=-wK0BUqTBcgONhCjn2Dgx Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQA855ltXjRwWofFmQkRAo+NAJ0SLe5XzoOvp4qIa0e4ns8ySbMzCACffjSf TbaXbXwYDekrhOFmAsz1zEc= =CeUq -----END PGP SIGNATURE----- --=-wK0BUqTBcgONhCjn2Dgx-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message