Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2004 18:06:12 -0500
From:      Marc Ramirez <marc.ramirez@bluecirclesoft.com>
To:        Jeremy Faulkner <gldisater@gldis.ca>
Cc:        freebsd-chat@freebsd.org
Subject:   Re: Could use some help with variable length argument lists
Message-ID:  <20040210230611.GB39506@www.bluecirclesoft.com>
In-Reply-To: <402940EC.2030403@gldis.ca>
References:  <40293B38.30401@potentialtech.com> <402940EC.2030403@gldis.ca>

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

--7iMSBzlTiPOCCT2k
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Feb 10, 2004 at 03:37:00PM -0500, Jeremy Faulkner wrote:
>=20
>=20
> va_start says that the last required variable is "message".
>=20
> You can't use ap because it's not in the list of variables when you=20
> called the function.

ap doesn't represent a parameter, it represents the list. C/C++ have
no way of knowing how many parameters were passed in.  The information
in "message" tells the function how many parameters are in the list.

> _log(1, "Log test");
> 		  ^ There's nothing there to be "ap"
>=20
> So it "Segmentation fault (core dumped)"'s
>=20
> _log(1, "Log test", NULL);

If that were true, then

	printf("Hello, world!");

could never work.

Marc.

> --=20
> Jeremy Faulkner				http://www.gldis.ca
> _______________________________________________
> freebsd-chat@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-chat
> To unsubscribe, send any mail to "freebsd-chat-unsubscribe@freebsd.org"

--=20
Marc Ramirez
Blue Circle Software Corporation
513-688-1070 (main)
513-382-1270 (direct)
http://www.bluecirclesoft.com
http://www.mrami.com (personal)

--7iMSBzlTiPOCCT2k
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD4DBQFAKWPig1EgpGw750IRArrhAJUZR4qHXkFWwz6GZOXSd/7VXX//AJ9Fk9/K
OwpY/MNzZfh8bXGAKwAyXg==
=aveT
-----END PGP SIGNATURE-----

--7iMSBzlTiPOCCT2k--



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