www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - example no longer working because of changed casting rules?

reply Roel Mathys <roel.mathys yucom.be> writes:
The first example does not compile any more on DMD090, I guess a 
side-effect of changing the casting rules.

(To the bottom of the page: http://www.digitalmars.com/d/index.html )

































int function(char c) fp; // declare pointer to a function void test() { static int foo(char c) { return 6; } fp = foo; } is exactly equivalent to: int function(char c) fp; void test() { fp = function int(char c) { return 6;} ; } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< regards, roel
May 24 2004
parent reply "Ivan Senji" <ivan.senji public.srce.hr> writes:
"Roel Mathys" <roel.mathys yucom.be> wrote in message
news:c8thde$96g$1 digitaldaemon.com...
 The first example does not compile any more on DMD090, I guess a
 side-effect of changing the casting rules.

 (To the bottom of the page: http://www.digitalmars.com/d/index.html )

  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 For example:

 int function(char c) fp; // declare pointer to a function

 void test()
 {
     static int foo(char c) { return 6; }

     fp = foo;

this should be: fp = &foo;
 }


 is exactly equivalent to:

 int function(char c) fp;

 void test()
 {
     fp = function int(char c) { return 6;} ;
 }
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 regards,
 roel

May 24 2004
parent reply Roel Mathys <roel.mathys yucom.be> writes:
Ivan Senji wrote:
 "Roel Mathys" <roel.mathys yucom.be> wrote in message
 news:c8thde$96g$1 digitaldaemon.com...
 
The first example does not compile any more on DMD090, I guess a
side-effect of changing the casting rules.

(To the bottom of the page: http://www.digitalmars.com/d/index.html )

































int function(char c) fp; // declare pointer to a function void test() { static int foo(char c) { return 6; } fp = foo;

this should be: fp = &foo;
}


is exactly equivalent to:

int function(char c) fp;

void test()
{
    fp = function int(char c) { return 6;} ;
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

regards,
roel


should be updated. http://www.digitalmars.com/d/expression.html roel
May 24 2004
parent "Walter" <newshound digitalmars.com> writes:
"Roel Mathys" <roel.mathys yucom.be> wrote in message
news:c8uk0h$2ddl$1 digitaldaemon.com...
 right, but the documentation on this page concerning Function Literals
 should be updated.

 http://www.digitalmars.com/d/expression.html

Done. Thanks
May 25 2004