digitalmars.D - Is this implemented?
- uframer (19/19) Feb 07 2005 The document reads "It is an error to return the address of or a referen...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (5/8) Feb 07 2005 Just because you got away with it, doesn't make it legal ;-)
- Regan Heath (4/12) Feb 07 2005 I like it! "DMD007 licensed to kill".
The document reads "It is an error to return the address of or a reference
to a local variable." in the section of Local Variables in function.html .
But when i use dmd 0.112 to compile this:
<code>
import std.c.stdio;
int* f()
{
int a;
return &a;
}
int main ( char [] [] args )
{
int* b = f();
getchar();
return 1;
}
</code>
it succeeded.
Is this an unimplemented feature or i've missed something?
Feb 07 2005
uframer wrote:The document reads "It is an error to return the address of or a reference to a local variable." in the section of Local Variables in function.html .[...]Is this an unimplemented feature or i've missed something?Just because you got away with it, doesn't make it legal ;-) That spec line just gives a future compiler a license to kill. --anders
Feb 07 2005
On Mon, 07 Feb 2005 11:33:22 +0100, Anders F Björklund <afb algonet.se> wrote:uframer wrote:I like it! "DMD007 licensed to kill". ReganThe document reads "It is an error to return the address of or a reference to a local variable." in the section of Local Variables in function.html .[...]Is this an unimplemented feature or i've missed something?Just because you got away with it, doesn't make it legal ;-) That spec line just gives a future compiler a license to kill.
Feb 07 2005








"Regan Heath" <regan netwin.co.nz>