root icon indicating copy to clipboard operation
root copied to clipboard

[cmake] add -Wno-error to mathcore and minuit

Open silverweed opened this issue 6 months ago • 3 comments

In MathCore and Minuit there are warnings stemming from -Winconsistent-missing-override (like: 'Gradient' overrides a member function but is not marked 'override').

Applying the suggested fix doesn't work because the functions in question are only conditionally overriding a base class function, depending on the type used as their CRTP argument.

This should probably be fixed in a better way, but in the meantime this commit allows building ROOT with dev=ON, which now fails.

silverweed avatar Jun 17 '25 08:06 silverweed

Alternative suggestion:

use in the five involved places:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winconsistent-missing-override"
  virtual Gradient()...;
#pragma GCC diagnostic pop

ferdymercury avatar Jun 17 '25 08:06 ferdymercury

The proper solution would be to not make that function conditionally virtual, but that requires some thought and knowledge of the code which I don't have at the moment..

Silencing the warning should be done only if no good alternative is found.

silverweed avatar Jun 17 '25 08:06 silverweed

Test Results

    19 files      19 suites   3d 22h 36m 56s ⏱️  2 816 tests  2 811 ✅   0 💤 5 ❌ 52 002 runs  51 862 ✅ 135 💤 5 ❌

For more details on these failures, see this check.

Results for commit 8b558195.

github-actions[bot] avatar Jun 17 '25 11:06 github-actions[bot]

@lmoneta

dpiparo avatar Jun 18 '25 09:06 dpiparo

Alternative PR: https://github.com/root-project/root/pull/19070

ferdymercury avatar Jun 18 '25 09:06 ferdymercury

Superseded by https://github.com/root-project/root/pull/19070

silverweed avatar Jun 18 '25 10:06 silverweed