[Issue 22987] __traits(getLocation) needs a way to get an absolute path.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 26 05:54:31 UTC 2024


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

Richard Cattermole <alphaglosined at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaglosined at gmail.com

--- Comment #3 from Richard Cattermole <alphaglosined at gmail.com> ---
(In reply to Walter Bright from comment #2)
> Why not use:
> 
> https://dlang.org/phobos/std_path.html#absolutePath

That would require knowing the base address to make absolute against.

For build systems like dub, that information may very well not exist, or be
assumable.

You have to make assumptions to reconstruct information that the compiler could
just tell you. That is not a good solution, it is a workaround at best.

Not to mention cross compilation could result in a wrong result if it works at
all.

--


More information about the Digitalmars-d-bugs mailing list