From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 18 20:16:33 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A293DFF; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 724431FFE; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGX8x027980; Tue, 18 Feb 2014 20:16:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGXMB027979; Tue, 18 Feb 2014 20:16:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGXMB027979@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/9/share/man/man3/stdarg.3 Directory Properties: stable/9/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/stdarg.3 stable/8/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/stdarg.3 ============================================================================== --- stable/9/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/9/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo