This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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
Attachment:
msg00031/pgp00000.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |