Modifying data returned by __builtin_apply_args()

Frank Penczek frank.penczek@googlemail.com
Tue Feb 13 03:03:00 GMT 2007


Dear Listmembers,

I'd like to omit the first parameter in the data object which
__builtin_apply_args() returns.


Example:
-----------------

/* function to be called */
void fun( int p0, int p1, int p2) {
  /* do something */
}

/* function call wrapper */
void call( void (*fun)(), int p0, ...) {
  int size;
  void **args;

  size = CalculateSize(); /* leaving aside details*/
  args = __builtin_apply_args();

  /* --> modify args here */

  __builtin_apply( fun, args, size);
}

/* using the above */
...
call( &fun, 42, 0, 8);
...
-----------------

How do I strip the function pointer passed as first parameter
to 'call()' from 'args'?

If you bothered reading up to this point, thanks a lot
for your time.

Cheers,
 Frank



More information about the Gcc-help mailing list