Skip to content

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Aug 25, 2025

  • Undocuments the -wi option
  • All warnings are now counted, not just when useWarnings == error.
  • Removes errorOnWarning from the driver.

The -w and -wi options still set useWarnings as error and inform respectively, this is because the "cannot inline function" warning is only diagnosed when warnings are informational. Given that druntime and phobos are built with -w, it would introduce a number of new messages when compiling.

std/internal/entropy.d(503): Warning: cannot inline function `std.internal.entropy.crashOnError`
pragma(inline, true) void crashOnError(const EntropyResult value) pure @safe
                          ^
std/math/exponential.d(4292): Warning: cannot inline function `std.math.exponential._scalbn!real._scalbn`
private F _scalbn(F)(F x, int n)
          ^
std/math/exponential.d(4292): Warning: cannot inline function `std.math.exponential._scalbn!double._scalbn`
private F _scalbn(F)(F x, int n)
          ^
std/math/exponential.d(4292): Warning: cannot inline function `std.math.exponential._scalbn!float._scalbn`
private F _scalbn(F)(F x, int n)
          ^

- Undocuments the `-wi` option
- All warnings are now counted, not just when useWarnings == error.
- Removes errorOnWarning from the driver.

The `-w` and `-wi` options still set useWarnings as error and inform
respectively, this is because the "cannot inline function" warning is
only diagnosed when warnings are informational. Given that druntime and
phobos are built with `-w`, it would introduce a number of new messages
when compiling.

```
std/internal/entropy.d(503): Warning: cannot inline function `std.internal.entropy.crashOnError`
pragma(inline, true) void crashOnError(const EntropyResult value) pure @safe
                          ^
std/math/exponential.d(4292): Warning: cannot inline function `std.math.exponential._scalbn!real._scalbn`
private F _scalbn(F)(F x, int n)
          ^
std/math/exponential.d(4292): Warning: cannot inline function `std.math.exponential._scalbn!double._scalbn`
private F _scalbn(F)(F x, int n)
          ^
std/math/exponential.d(4292): Warning: cannot inline function `std.math.exponential._scalbn!float._scalbn`
private F _scalbn(F)(F x, int n)
          ^
```
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#21780"

@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 25, 2025

Leaning towards moving -wi -> -winline to handle the "cannot inline function" informational messages. As the fact that it choses not to warn about them when warnings were treated as errors is itself odd.

@dkorpel dkorpel added the Review:Needs Changelog A changelog entry needs to be added to /changelog label Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Diagnostic Messages Review:Needs Changelog A changelog entry needs to be added to /changelog Review:Needs Rebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants