[cfe-dev] my experience with clang

Chris Lattner clattner at apple.com
Sat Jan 12 00:17:54 PST 2008


> I doubt that anytime soon compilers will be able to analyze these  
> varargs
> functions automatically (well, you could try to do use some  
> heuristics, like
> searching for a switch, but..), so my idea was to expose some kind  
> of API to
> the programmers to allow them to specify some arbitrary function to  
> validate
> the arguments.
> GCC supports the following:
> void my_printf(const char *format, ...)   
> __attribute__((format(printf, 1,
> 2)));
>
> but GCC only supports the printf and scanf functions. My idea was to
> generalize this, by allowing the user to specify some function  
> (without
> touching in the compiler's code).
> While the idea seems fairly acceptable, I don't have any syntax  
> proposal.
>
> Reference: http://gcc.gnu.org/ml/gcc/2006-11/msg00331.html

Something like this would be very nice, but it has to be simple enough  
to be comprehendible by actual mortals, therein lies the trick :)

-Chris



More information about the cfe-dev mailing list