From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32119 invoked by alias); 15 Feb 2003 00:14:24 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32097 invoked by uid 48); 15 Feb 2003 00:14:24 -0000 Date: Sat, 15 Feb 2003 00:14:00 -0000 Message-ID: <20030215001424.32096.qmail@sources.redhat.com> To: agriffis@gentoo.org, bjb@gentoo.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, msterret@coat.com, nobody@gcc.gnu.org, wwoods@gentoo.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, agriffis@gentoo.org, bjb@gentoo.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, msterret@coat.com, nobody@gcc.gnu.org, wwoods@gentoo.org, gcc-gnats@gcc.gnu.org Subject: Re: c/9700: va_start gets __offset wrong in some situations X-SW-Source: 2003-02/txt/msg00653.txt.bz2 List-Id: Synopsis: va_start gets __offset wrong in some situations State-Changed-From-To: open->closed State-Changed-By: bangerth State-Changed-When: Sat Feb 15 00:14:24 2003 State-Changed-Why: Not a bug. The man page says: The first use of the va_arg macro after that of the va_start macro returns the argument after last. Succes­ sive invocations return the values of the remaining argu­ ments. You also get the "two" from this small example: #include void func(const char *first_custom, ...) { char *s; va_list custom_args; va_start (custom_args, first_custom); s = va_arg(custom_args, char *); printf ("%s\n", s); va_end (custom_args); } int main() { func("one", "two", "three"); } (also on Linux). Given the description on the man page, this is not surprising. W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9700