This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: alloca + inline


Xanthakis Stelios wrote:-

> 
> Hello.
> 
> I did some tests with gcc 3.2 and -as expected- alloca is preserved
> in inline functions. 
> Which means that we can say:
> 
> 	static inline void *calloca (int i)
> 	{
> 		void *ret = alloca (i);
> 		memset(ret, 0, i);
> 		return ret;
> 	}
> 
> 
> Can you guarantee that it will always be so?
> Can we consider this standard behaviour?

Assuming anything to do with "inline" is not a good plan, IMO.
Just look at the never-ending thread that has been going in fits
and starts for about 1 month 8-)

In fact, assuming almost anything where a reasonable implementation
could change, is not a good idea.  Certainly GCC will not apologize
for breaking code whose correctness depends on such assumptions.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]