dlang-community / mecca

Weka.IO's userland OS
Boost Software License 1.0
64 stars 16 forks source link

Fix build with -dip25 and prevent regressions #13

Closed PetarKirov closed 5 years ago

PetarKirov commented 5 years ago

Functions that return by ref their formal parameters (or the this implicit parameter) need to have the return attribute, so the compiler can catch cases where the return value outlives the function argument it was derived from. This attribute is inferred (just like e.g. nothrow or pure) for function templates (or functions defined inside templates), nested functions and auto-returning functions. The -dip25 flag enforces this static analysis and it will become the default in one the future releases.

This pull request enables this flag and fixes the compilation errors.

We're currently in the process of fixing projects on BuildKite such as yours, in order to ease the community for the transition. The transition is most likely going to happen through a deprecation phase (e.g. it won't be a hard-error for one more releases), but it's a good idea to prepare in advance.

EyalIO commented 5 years ago

Thanks!

PetarKirov commented 5 years ago

You're welcome! Can you also tag a new release?