Is alloca part of the C++ standard?
No. The answer says it all.
No. The answer says it all.
implementing alloca actually requires compiler assistance. A few people here are saying it’s as easy as: sub esp, <size> which is unfortunately only half of the picture. Yes that would “allocate space on the stack” but there are a couple of gotchas. if the compiler had emitted code which references other variables relative to esp … Read more
The answer is right there in the man page (at least on Linux): RETURN VALUE The alloca() function returns a pointer to the beginning of the allocated space. If the allocation causes stack overflow, program behaviour is undefined. Which isn’t to say it should never be used. One of the OSS projects I work on … Read more