H1 2015 Priorities and Bare-Metal Programming
Daniel Murphy via Digitalmars-d
digitalmars-d at puremagic.com
Tue Feb 3 03:05:43 PST 2015
"Walter Bright" wrote in message news:maq8ao$2idu$1 at digitalmars.com...
> Yup. I understand the concern that a compiler would opt out of inlining
> those if it legally could, but I just cannot see that happening in
> reality. Modern compilers have been inlining for 25 years now, and they're
> not likely to just stop doing it.
No, the problem is that the code might accidentally contain a construct that
is not inlineable. The user will expect it to be inlined, but the compiler
will silently fail.
eg
void myWrapperFunc()
{
callSomeFunc(999, 123, "something");
}
This function will not be inlined if callSomeFunc has a default arugment
that calls alloca, for example. If a hidden failure becomes a compiler
error, the user can trivially correct the problem.
More information about the Digitalmars-d
mailing list