[Issue 14419] [CTFE] Need infinite loop detection?

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 6 11:24:25 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14419

--- Comment #12 from Jens Bauer <jens-bugzilla at gpio.dk> ---
(In reply to Ketmar Dark from comment #3)
> alias extern(C) immutable void function () VectorFunc;
> VectorFunc[3] g_pfnVectors = [
>   Reset_Handler,
> ];
> 
> extern(C) void Reset_Handler () {
>   while (true) {}
> }
> 
> there is no sense to evaluate `Reset_Handler`, as it's return value
> (actually, absense of) is not suitable as array element.

There is another detail here, which I just noticed:
In the array, I do not give the function any arguments / parameters.

-Shouldn't that be reported as an error, or is it intended that functions are
callable like this:
a = printf;

... ?

In C, a would be a pointer to the function printf, however in D, a would
contain the result of the execution.

--


More information about the Digitalmars-d-bugs mailing list