[PATCH]: Proof-of-concept for dynamic format checking

Florian Weimer fw@deneb.enyo.de
Wed Aug 17 20:25:00 GMT 2005


* Ian Lance Taylor:

> Florian Weimer <fw@deneb.enyo.de> writes:
>
>> If I understand your %A/%B example correctly, it would look like this:
>
> OK, I can see how that might work in a simple case.  Now, can you give
> me an example of matching %d with the various flags?  In particular,
> are you going to write a loop, and is gcc going to somehow fully
> unroll that loop at compile time?

This is indeed a problem (with GCC 4.0 at least).  A regexp builtin
which returns the length of the matched string probably could probably
solve this.  Managing state so that you can still compose multiple
checkers is the harder part, I think.



More information about the Gcc mailing list