update variable-arguments documentation in README.Portability
Matt Kraai
kraai@alumni.cmu.edu
Mon Jul 1 12:06:00 GMT 2002
Howdy,
README.Portability does not document the new method of handling
variable-argument function using VA_OPEN, VA_FIXEDARG, and
VA_CLOSE. The following patch updates it.
OK to commit?
Matt
* README.Portability (Function prototypes): Document new
variable-argument function macros.
Index: gcc/README.Portability
===================================================================
RCS file: /cvs/gcc/gcc/gcc/README.Portability,v
retrieving revision 1.6
diff -c -3 -r1.6 README.Portability
*** gcc/README.Portability 16 Jul 2000 13:35:23 -0000 1.6
--- gcc/README.Portability 1 Jul 2002 19:01:43 -0000
***************
*** 139,170 ****
void
cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...))
! {
! #ifndef ANSI_PROTOTYPES
! cpp_reader *pfile;
! const char *msgid;
! #endif
! va_list ap;
!
! VA_START (ap, msgid);
!
! #ifndef ANSI_PROTOTYPES
! pfile = va_arg (ap, cpp_reader *);
! msgid = va_arg (ap, const char *);
! #endif
...
! va_end (ap);
}
! For the curious, here are the definitions of the above macros. See
! ansidecl.h for the definitions of the above macros and more.
!
! #define PARAMS(paramlist) paramlist /* ISO C. */
! #define VPARAMS(args) args
!
! #define PARAMS(paramlist) () /* K+R C. */
! #define VPARAMS(args) (va_alist) va_dcl
One aspect of using K+R style function declarations, is you cannot
have arguments whose types are char, short, or float, since without
--- 139,154 ----
void
cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...))
! {
! VA_OPEN (ap, msgid);
! VA_FIXEDARG (ap, cpp_reader *, pfile);
! VA_FIXEDARG (ap, const char *, msgid);
...
! VA_CLOSE (ap);
}
! See ansidecl.h for the definitions of the above macros and more.
One aspect of using K+R style function declarations, is you cannot
have arguments whose types are char, short, or float, since without
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020701/c20a088e/attachment.sig>
More information about the Gcc-patches
mailing list