Thread overview
[Issue 20023] Separate compilation breaks dip1000 / dip1008 @safety
Jul 03, 2019
John Colvin
Jul 03, 2019
John Colvin
July 03, 2019
https://issues.dlang.org/show_bug.cgi?id=20023

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |critical

--
July 03, 2019
https://issues.dlang.org/show_bug.cgi?id=20023

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, safe

--
March 14
https://issues.dlang.org/show_bug.cgi?id=20023

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|---                         |WONTFIX

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
This is explained because some of the checks are only done for modules that are present on the command line. You can see this in the line:

    if (sc._module && sc._module.isRoot() &&

https://github.com/dlang/dmd/blob/master/src/dmd/escape.d#L1205

You can find the isRoot() check in several places.

This is done to ease the transition to dip1000 by not checking code that is only imported, presumably from 3rd party libraries which would be impractical for the user to change himself.

Once dip1000 becomes thoroughly propagated to old libraries, this can be tightened up, but not now.

--
March 14
https://issues.dlang.org/show_bug.cgi?id=20023

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry

--- Comment #2 from John Colvin <john.loughran.colvin@gmail.com> ---
(In reply to Walter Bright from comment #1)
> This is explained because some of the checks are only done for modules that are present on the command line. You can see this in the line:
> 
>     if (sc._module && sc._module.isRoot() &&
> 
> https://github.com/dlang/dmd/blob/master/src/dmd/escape.d#L1205
> 
> You can find the isRoot() check in several places.
> 
> This is done to ease the transition to dip1000 by not checking code that is only imported, presumably from 3rd party libraries which would be impractical for the user to change himself.
> 
> Once dip1000 becomes thoroughly propagated to old libraries, this can be tightened up, but not now.

Wow, I did not realise that was the case.

Does this mean that many things I think are really safe aren't at all? Depending on exactly how I compile my code? That sounds like a nightmare.

Unless I'm misunderstanding you, I desperately want to be able to turn this transition aid off immediately and go fix the problems it has been hiding.

Also, should this really be closed as wontfix? Presumably it will be fixed, just not yet?

Adding industry.

--
March 16
https://issues.dlang.org/show_bug.cgi?id=20023

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #3 from John Colvin <john.loughran.colvin@gmail.com> ---
I'm going to reopen as this is presumably going to be fixed, either as a switch or the eventual "tightening up" and in the meantime it's a really nasty thing to trip over.

--
June 26
https://issues.dlang.org/show_bug.cgi?id=20023

--- Comment #4 from John Colvin <john.loughran.colvin@gmail.com> ---
Discussed on a call with Walter, seems like he misunderstood the original example.

To be clear: putting -dip1000 -dip1008 -dip25 on all the modules does not mean all the code is actually checked by those dips.

--
October 09
https://issues.dlang.org/show_bug.cgi?id=20023

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
Probably the way to fix this is to add a switch which says make these checks transitive.

--