home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / gcc / bug / 3009 < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.5 KB  |  61 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!wrc.xerox.COM!leisner
  3. From: leisner@wrc.xerox.COM ( Marty Leisner)
  4. Subject: Can a varargs simple function be inlined?
  5. Message-ID: <1992Dec16.193725.17942@spectrum.xerox.com>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: leisner@eso.mc.xerox.com
  8. Organization: Xerox
  9. Distribution: gnu
  10. Date: Wed, 16 Dec 1992 19:37:25 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 47
  13.  
  14. I'm running gcc 2.3.2 on sparcs, sunos 4.1.2
  15.  
  16. I have a simple function which I want to inline which uses varargs...
  17.  
  18.      4  static void inline test_args( char *fmt, ...)
  19.      5  {
  20.      6  #if 0
  21.      7          va_list args;
  22.      8  
  23.      9          va_start(args, fmt);
  24.     10  
  25.     11          vfprintf(stderr, fmt, args);
  26.     12  
  27.     13          va_end(args);
  28.     14  #endif
  29.     15  }
  30.  
  31. I used -finline-functions and received a warning:
  32. "inline declaration ignored for function with `...'
  33.  
  34. So I played around and tried:
  35.      3  #ifndef 0
  36.      4  static void test_args()
  37.      5  {
  38.      6  }
  39.      7  #else
  40.      8  static void inline test_args( char *fmt, ...)
  41.      9  {
  42.     10          va_list args;
  43.     11  
  44.     12          va_start(args, fmt);
  45.     13  
  46.     14          vfprintf(stderr, fmt, args);
  47.     15  
  48.     16          va_end(args);
  49.     17  }
  50.     18  #endif
  51.  
  52. and I can't seem to make an empty function inline  (removing the call).
  53.  
  54. Hints?
  55.  
  56. --
  57. marty
  58. leisner.henr801c@xerox.com  leisner@eso.mc.xerox.com
  59. Member of the League for Programming Freedom
  60.  
  61.