Skip site navigation (1)Skip section navigation (2)
Date:      19 May 2002 22:24:14 +1000
From:      Benno Rice <benno@FreeBSD.org>
To:        hackers@freebsd.org
Subject:   va_copy in libc
Message-ID:  <1021811056.574.6.camel@ratchet.jeamland.net>

next in thread | raw e-mail | index | archive | help

--=-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




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