expanding __attribute__((format,..))

Nuno Lopes nunoplopes@sapo.pt
Fri Nov 10 17:14:00 GMT 2006


Hi,

I've been thinking that it would be a good idea to extend the current 
__attribute__((format,..)) to use an arbitrary user callback.
I searched the mailing list archives and I found some references to similar 
ideas. So do you think this is feasible?

It would allow specifying arbitrary char codes and also arbitrary number of 
required arguments. It would be nice if it could also import the attributes 
from other defined callbacks.

E.g.:
#define my_format_callback(x,params)
    (import printf),
    ("%v",        zval**, size_t),
    ("%foo",     void*)

int my_printf(char *format, ...) 
__attribute__((format,("my_format_callback")))


Thanks in advance,
Nuno 



More information about the Gcc mailing list