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
[-- Attachment #1 --]
On Tue, Feb 10, 2004 at 03:37:00PM -0500, Jeremy Faulkner wrote:
>
>
> va_start says that the last required variable is "message".
>
> You can't use ap because it's not in the list of variables when you
> 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"
>
> So it "Segmentation fault (core dumped)"'s
>
> _log(1, "Log test", NULL);
If that were true, then
printf("Hello, world!");
could never work.
Marc.
> --
> 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"
--
Marc Ramirez
Blue Circle Software Corporation
513-688-1070 (main)
513-382-1270 (direct)
http://www.bluecirclesoft.com
http://www.mrami.com (personal)
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD4DBQFAKWPig1EgpGw750IRArrhAJUZR4qHXkFWwz6GZOXSd/7VXX//AJ9Fk9/K
OwpY/MNzZfh8bXGAKwAyXg==
=aveT
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040210230611.GB39506>
