This is the mail archive of the gcc-help@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]

Modifying data returned by __builtin_apply_args()


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]