Aleksandar Ristovski(deleted)
|
|
Aleksandar Ristovski(deleted)
06/12/2009 11:29 AM
post31626
|
Hello,
Current definition of alloca creates problems in code like this:
char *str = strcpy (alloca (strlen (command_str) + 1),
command_str);
Compiler generates error:
error: null argument where non-null required (argument 1)
Why did we define alloca the way we did?
If there is no particular reason, then would something like
this patch (attached) make sense?
(Disclaimer: this is not patch submission, but rather an
illustration - I don't know what would be the right way to
specify always_inline attribute or inline modifier to make
all supported compilers happy).
Thanks,
Aleksandar
|
|
|