a new pass, "globalization", for user-space virtualization

mathieu lacage Mathieu.Lacage@sophia.inria.fr
Sat Sep 9 16:20:00 GMT 2006


On Sat, 2006-09-09 at 17:34 +0200, mathieu lacage wrote:

> Another solution would be to do something like this:
> 
> extern void *magic_function (void *variable_uid);
> 
> static int a;
> void foo (void)
> {
> 	void *ptr = magic_function (&a);
> 	int *pa = (int *)ptr;
> 	*pa = 1;
> }

I think that the code above should be:

extern void *magic_function (void *variable_uid, int size);
static int a;
void foo (void)
{
	void *ptr = magic_function (&a, sizeof (a));
	int *pa = (int *)ptr;
	*pa = 1;
}

Mathieu



More information about the Gcc mailing list