Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Wsign-compare warning/error #3349

Merged
merged 3 commits into from
Jul 27, 2022
Merged

Fix Wsign-compare warning/error #3349

merged 3 commits into from
Jul 27, 2022

Conversation

roystgnr
Copy link
Member

#3208 is failing a few of the devel->master CI checks because of this.

https://civet.inl.gov/event/94816/

@roystgnr
Copy link
Member Author

Added the failing CI recipes here.

@jwpeterson
Copy link
Member

Ugh. I don't get how it passed all the CI though, don't we have some -Werror recipes on devel still?

@roystgnr
Copy link
Member Author

We do, but I'm betting we only have them with 64-bit PETSc right now, and -Wsign-compare thinks that int64 > uint32 is a fine thing to test.

@roystgnr
Copy link
Member Author

And hopefully that fixes the LIBMESH_CHKERR+exceptions-disabled+non-ParallelObject-callback-function interaction too. I'd appreciate another set of eyes on the refactoring getting rid of _max_its, though.

@jwpeterson
Copy link
Member

../src/solvers/petsc_nonlinear_solver.C: In function 'PetscErrorCode libMesh::libmesh_petsc_recalculate_monitor(SNES, PetscInt, PetscReal, void*)':
../src/solvers/petsc_nonlinear_solver.C:117:52: error: 'ctx' was not declared in this scope; did you mean 'mctx'?
  117 |       static_cast<PetscNonlinearSolver<Number> *> (ctx);
      |                                                    ^~~
      |                                                    mctx
../src/solvers/petsc_nonlinear_solver.C: In constructor 'libMesh::PetscNonlinearSolver<T>::PetscNonlinearSolver(libMesh::PetscNonlinearSolver<T>::sys_type&)':
../src/solvers/petsc_nonlinear_solver.C:650:3: error: class 'libMesh::PetscNonlinearSolver<T>' does not have any field named '_max_its'
  650 |   _max_its(0)
      |   ^~~~~~~~
../src/solvers/petsc_nonlinear_solver.C: In member function 'virtual std::pair<unsigned int, double> libMesh::PetscNonlinearSolver<T>::solve(libMesh::SparseMatrix<T>&, libMesh::NumericVector<T>&, libMesh::NumericVector<T>&, double, unsigned int)':
../src/solvers/petsc_nonlinear_solver.C:883:7: error: '_max_its' was not declared in this scope
  883 |       _max_its = reuse_preconditioner_max_its();
      |       ^~~~~~~~

This lets us use the solver's comm() in cases where we can't throw
exceptions.
@moosebuild
Copy link

moosebuild commented Jul 27, 2022

Job Coverage on a9a8f02 wanted to post the following:

Coverage

b6c94e #3349 a9a8f0
Total Total +/- New
Rate 55.72% 55.72% +0.00% 44.44%
Hits 44954 44954 - 4
Misses 35722 35720 -2 5

Diff coverage report

Full coverage report

Warnings

  • New new line coverage rate 44.44% is less than the suggested 90.0%

This comment will be updated on new commits.

Why'd we even write this maximum-compatibility macro if we weren't going
to use it?
@roystgnr roystgnr merged commit 401bca7 into libMesh:devel Jul 27, 2022
@roystgnr roystgnr deleted the 3208_fixes branch July 27, 2022 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants