This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Proof-of-concept for dynamic format checking
- From: Mike Stump <mrs at apple dot com>
- To: Dave Korn <dave dot korn at artimi dot com>
- Cc: "'Florian Weimer'" <fw at deneb dot enyo dot de>, "'Ian Lance Taylor'" <ian at airs dot com>, "'Giovanni Bajo'" <giovannibajo at libero dot it>, "'Joseph S. Myers'" <joseph at codesourcery dot com>, gcc at gcc dot gnu dot org, ghazi at caipclassic dot rutgers dot edu
- Date: Thu, 18 Aug 2005 12:09:53 -0700
- Subject: Re: [PATCH]: Proof-of-concept for dynamic format checking
- References: <SERRANOEhGD1XyCTr9r00000101@SERRANO.CAM.ARTIMI.COM>
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.