Skip to content

[Framework] Cmake: set warnings-as-errors in all the Framework targets - #6145

Open
fredroy wants to merge 6 commits into
sofa-framework:masterfrom
fredroy:framework_warnings_as_errors
Open

fredroy wants to merge 6 commits into
sofa-framework:masterfrom
fredroy:framework_warnings_as_errors

Conversation

@fredroy

@fredroy fredroy commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Based on

The continuation of #5914 ,#6027, #6028, #6034......
This should make the compilation of the target Sofa.Framework warning-free.... with the current flags.

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels Jun 8, 2026
@fredroy fredroy changed the title [Framwork] Cmake: set warnings-as-errors in all the Framework targets [Framework] Cmake: set warnings-as-errors in all the Framework targets Jun 8, 2026
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch 6 times, most recently from 9048206 to d2e7617 Compare June 8, 2026 23:40
@fredroy

fredroy commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

[ci-build][with-all-tests]

@fredroy fredroy added the pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently label Jun 9, 2026
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from d2e7617 to 04cd3bd Compare June 9, 2026 23:08
@hugtalbot

Copy link
Copy Markdown
Contributor

When updating of VMs / CIs, warnings are to be expected therefore creating errors. Let's discuss this with @bakpaul

@hugtalbot hugtalbot added this to the v26.06 milestone Jun 12, 2026
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 04cd3bd to 02ee377 Compare June 14, 2026 21:58
@fredroy fredroy removed the pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently label Jun 14, 2026
@bakpaul

bakpaul commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Yes indeed, I would like to merge it after the CI migration !

@alxbilger alxbilger added the pr: highlighted in next release Highlight this contribution in the notes of the upcoming release label Jun 18, 2026
@fredroy fredroy modified the milestones: v26.06, v26.12 Jun 18, 2026
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from cdf7516 to 707296d Compare June 26, 2026 07:04
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 707296d to 46ac27b Compare July 8, 2026 22:50
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 46ac27b to 9fe8103 Compare July 20, 2026 22:32
@fredroy fredroy added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Sep 10, 2026
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 9fe8103 to b15ad55 Compare October 7, 2026 00:23
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from b15ad55 to 8cb4e75 Compare October 25, 2026 23:56
@alxbilger alxbilger added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Oct 26, 2026
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 9d9e009 to 15c954d Compare October 30, 2026 04:22
@fredroy fredroy added the pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently label Oct 30, 2026
@hugtalbot
hugtalbot self-requested a review November 5, 2026 09:06
fredroy and others added 4 commits November 9, 2026 07:13
- BaseMass: make the deprecated getPotentialEnergy(mparams) overload
  non-virtual (it was final) so Mass<T> no longer hides it
- ImplicitIntegrationScheme: mark integration factor methods override
- Remove unused MechanicalGetNonDiagonalMassesCountVisitor includes
- MechanicalOperations: silence deprecated-header messages for the
  PropagateDx visitors it still uses internally
- BaseLink::readFromSnapshot: rename the link value string so the
  loop variable linkPath no longer hides it (C4456)
- ObjectElement::initNode: rename local parent to parentElement so it
  no longer hides the Element::parent member (C4458)
- CompressedRowSparseMatrixGeneric::compressCSR: wrap the body in
  if constexpr (Policy::CompressZeros) instead of an early return
- FixedArrayTypeInfo::setSize: move the fallback return into an
  else branch of the if constexpr
- BackTrace: remove the dead return after the switch in SigDescription,
  the default case already returns
- DynamicLibrary: explicitly cast the GetProcAddress result to void*
  (-Wmicrosoft-cast)
- PipeProcess: remove the set-but-unused busy flag in the Windows
  branch (-Wunused-but-set-variable)
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 15c954d to 6fb8a2a Compare November 8, 2026 23:41
- BaseForceField, BaseMass: make the deprecated addDForce(mparams, dfId)
  and accFromF(mparams, aid) overloads non-virtual (they were final) so
  ForceField, Mass, PairInteractionForceField and
  MixedInteractionForceField no longer hide them (-Woverloaded-virtual)
- Core config: do not mark beginIntegration as deprecated when building
  Sofa.Simulation.Core, whose deprecated
  MechanicalBeginIntegrationVisitor still calls it
  (-Wdeprecated-declarations)
- MechanicalIntegrationVisitor: silence the deprecated-header message
  of MechanicalBeginIntegrationVisitor, which it still uses
- DefaultAnimationLoop: remove the unused
  MechanicalBeginIntegrationVisitor include and mark dt as unused
  (-Wunused-parameter)
- MechanicalMassLinearSolveVisitor: include its own header instead of
  the deprecated MechanicalAccFromFVisitor.h
- Mass overrode the deprecated ForceField::addDForce(mparams, df, dx)
    with an empty body, which triggered C4996 in every module including
    Mass.h (e.g. Sofa.Simulation.Core). The base implementation is also
    empty, so removing the override keeps the same behavior
@fredroy
fredroy force-pushed the framework_warnings_as_errors branch from 6fb8a2a to e31112e Compare November 9, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently pr: clean Cleaning the code pr: highlighted in next release Highlight this contribution in the notes of the upcoming release pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants