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?
I think it would be nice. We usually founder on trying to provide a
facility which can replace the builtin printf support, since printf is
very complicated.
Thanks for your quick answer. I'm glad that you are receptive to this
problem.
I kind of liked this idea:
http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00797.html
but of course it was insane.
And then there was this idea, which I think was almost workable:
http://gcc.gnu.org/ml/gcc/2005-08/msg00469.html
But nobody really liked it.
IMHO, those two seem way too difficult to use...
So you need to find something which is on the one hand very simple and
on the other hand able to support the complexity which people need in
practice.
I sent you some kind of proposal in the last e-mail (very LISP like,
unfortunately), but it seems somewhat good.
I'm a PHP developer and this feature would be really great for us, as
currently I do maintain a php script (regex-based) to do this kind of
verifications (and a few more, like checking for use of uninitialized vars).
But "parsing" C with regexes is kinda painful and error prone.
Nuno