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

Mike Stump mrs@apple.com
Thu Aug 18 19:10:00 GMT 2005


On Aug 18, 2005, at 5:08 AM, Dave Korn wrote:
>   I was referring to this bit:
>
>> Remember that it's not enough simply to execute the optimizers.   
>> You have to build a symbol table and an environment for the code  
>> to execute in.
>
> IIUIC, that would be a requirement for the optimisers to be able to
> perform the full constant-folding and get the same results as if the
> function was executed at runtime instead, wouldn't it?  It seems to  
> me like
> it would be quite a difficult thing to get right in a cross  
> environment.

Imagine the following program:

{
    int i = 234234;
    printf ("%d", i);
}

imagine the folder collapsing this to puts ("234234");

Or:

enum {
     foo=42;

foo() {
     printf("%d", (int)foo);
}

Hint, we already have a symbol table, it already works for cross  
compilation.



More information about the Gcc mailing list