httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: [Fwd: Problem 2534]
Date Tue, 04 Aug 1998 00:04:18 GMT

On Mon, 3 Aug 1998, Marc Slemko wrote:

> On Mon, 3 Aug 1998, Dean Gaudet wrote:
> > 
> > On Mon, 3 Aug 1998, Alexei Kosut wrote:
> > 
> > > Unless the file we're discussing (and this example is getting more and
> > > more theoretical) is the one that has the main() function.
> > 
> > Or the optimizer is part of the link stage, and a complete call graph can
> > be constructed, and dlopen() isn't used ;)
> Is it illegal for me to generate code on the stack or heap and run it?

Yes, as soon as you cast a data pointer to a function pointer you have
gone beyond the scope of what ANSI specifies.  Some systems have
sizeof(char *) != sizeof(char (*)()). 

> If it isn't illegal, you can't optimize this. 


However, you can attach attributes to function calls (much like the
prototype is an attribute, but you can further specify the details of the
called functions).  Provided you do the attributes right optimizations are
possible.  This means you also have to have attributes on function


> I know I _can_ do it on many or most systems, but...
> My bet is that it is either illegal or too stupid to be defined illegal.

View raw message