[Issue 19570] pragma(inline) is emitting symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 15 15:54:42 UTC 2020


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

Witold Baryluk <witold.baryluk+d at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |witold.baryluk+d at gmail.com

--- Comment #6 from Witold Baryluk <witold.baryluk+d at gmail.com> ---
I think you are confusing function being marked inline, and about non-emiting
object code of it or marking it weak. These are independent.

Compiler is free to ignore all `pragma(inline, ...)` statements, at any
optimization / flags settings.

What you want are `private final` symbol, or way to mark it weak. That would be
a better signal to compiler and linker.

`pragma(inline, ...)` is used for other things.

It even says so in the spec:

https://dlang.org/spec/pragma.html#inline

"""
Implementation defined:

2. Whether a particular function can be inlined or not is implementation
defined.
3. What happens for pragma(inline, true) if the function cannot be inlined. An
error message is typical.
"""

DMD default to emitting an error and aborting compilation when -inline flag is
used. IMHO that is meh solution, I would like warning and continue with
compilation.

--


More information about the Digitalmars-d-bugs mailing list