🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Marty Leisner Wed, 16 Dec 1992 19:37
Can a varargs simple function be inlined?
#1554
Author: Marty Leisner
Date: Wed, 16 Dec 1992 19:37
46 lines
1557 bytes
I'm running gcc 2.3.2 on sparcs, sunos 4.1.2

I have a simple function which I want to inline which uses varargs...

     4  static void inline test_args( char *fmt, ...)
     5  {
     6  #if 0
     7          va_list args;
     8  
     9          va_start(args, fmt);
    10  
    11          vfprintf(stderr, fmt, args);
    12  
    13          va_end(args);
    14  #endif
    15  }

I used -finline-functions and received a warning:
"inline declaration ignored for function with `...'

So I played around and tried:
     3  #ifndef 0
     4  static void test_args()
     5  {
     6  }
     7  #else
     8  static void inline test_args( char *fmt, ...)
     9  {
    10          va_list args;
    11  
    12          va_start(args, fmt);
    13  
    14          vfprintf(stderr, fmt, args);
    15  
    16          va_end(args);
    17  }
    18  #endif

and I can't seem to make an empty function inline  (removing the call).

Hints?

--
marty
leisner.henr801c@xerox.com  leisner@eso.mc.xerox.com
Member of the League for Programming Freedom
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads