"Walter Bright"  wrote in message news:maq7ra$2huu$1...@digitalmars.com...

To not inline trivial functions when presented with forceinline would indeed be perverse, and while legally possible as I've said before no compiler writer would do that. Even dmd (!) has no trouble at all inlining trivial functions.

See my alloca example.  I mistrust the inliner because I know has problems.

But the trouble is, people will use forceinline on very non-trivial functions, and functions where it would actually make things worse, etc., and then to have the compiler error out on them would not be productive.

See the Rust link I provided on experience with the use and misuse of forceinline.

Why do we have inline assembly? Why do we allow recursion? We can't stop programmers from doing stupid things, and we shouldn't be trying to.

Reply via email to