home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / gcc / help / 2005 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.4 KB  |  46 lines

  1. Newsgroups: gnu.gcc.help
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!ubc-cs!unixg.ubc.ca!ucs.ubc.ca!lindholm
  3. From: lindholm@ucs.ubc.ca (George Lindholm)
  4. Subject: gcc-2.2.2: varargs problem?
  5. Message-ID: <1992Aug28.215327.2534@unixg.ubc.ca>
  6. Sender: news@unixg.ubc.ca (Usenet News Maintenance)
  7. Nntp-Posting-Host: greve.ucs.ubc.ca
  8. Organization: University Computing Services, UBC, Canada
  9. Date: Fri, 28 Aug 1992 21:53:27 GMT
  10. Lines: 34
  11.  
  12. How do I prototype and define a procedure that takes a variable number of
  13. arguments? When I try the following on our Sun box:
  14. #include <varargs.h>
  15. void test(int a, va_alist);
  16. void test(a, va_alist)
  17. int a;
  18. va_dcl
  19. {
  20. }
  21.  
  22. I get:
  23. gcc -c a.c
  24. a.c:2: parse error before `__builtin_va_alist'
  25.  
  26. gcc -E reveals:
  27. void test(int a,  __builtin_va_alist );
  28. void test(a,  __builtin_va_alist )
  29. int a;
  30.    int __builtin_va_alist; ...  
  31. {
  32. }
  33.  
  34. If I change the prototype to 'void test(int a, ...)' gcc complains that
  35. a.c: In function `test':
  36. a.c:5: number of arguments doesn't match prototype
  37.  
  38. Any help would be appreciated. Thanks?
  39.  
  40.    George
  41. -- 
  42. George Lindholm                                  phone:    (604) 822-4375
  43. University Computing Services, UBC               fax:      (604) 822-5116
  44. 6356 Agricultural Road, Vancouver, B.C., Canada  internet: lindholm@ucs.ubc.ca
  45. V6T 1Z2                                          bitnet:   USERGNL@UBCMTSG
  46.