Skip to content

Fix Clang compiler warnings in fflib and PETSc/SLEPc plugins#386

Merged
prj- merged 1 commit intodevelopfrom
copilot/fix-null-passed-to-callee
Mar 26, 2026
Merged

Fix Clang compiler warnings in fflib and PETSc/SLEPc plugins#386
prj- merged 1 commit intodevelopfrom
copilot/fix-null-passed-to-callee

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 25, 2026

Several Clang warnings were being emitted across fflib and the MPI plugins. This PR addresses them with minimal, targeted fixes.

Changes

  • src/fflib/Operator.hpp — Fix -Wnonnull: nullptr was being used where a value of type R is required in Op2_padd::f. Replaced with R() (zero-initialized default):

    // Before
    new R ((a ? *a : nullptr) + (b ? *b : nullptr))
    // After
    new R ((a ? *a : R()) + (b ? *b : R()))
  • src/fflib/AFunction.hpp — Fix implicit const-pointer cast in memcpy: add explicit (void*) cast to the destination argument.

  • plugin/mpi/PETSc-code.hpp / plugin/mpi/SLEPc-code.hpp — Suppress -Wunused-value warnings emitted from within the PETSc/SLEPc headers using #pragma clang diagnostic push/pop. Also normalizes the slepc.h include to use angle brackets (<slepc.h>).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix warning for null passed to non-null argument Fix -Wnonnull warning in Op2_padd by replacing nullptr with R() Mar 25, 2026
Copilot AI requested a review from prj- March 25, 2026 14:55
Copilot finished work on behalf of prj- March 25, 2026 14:55
@prj- prj- force-pushed the copilot/fix-null-passed-to-callee branch from 5a2e55f to e1ec93f Compare March 25, 2026 19:01
Copilot AI changed the title Fix -Wnonnull warning in Op2_padd by replacing nullptr with R() Fix Clang compiler warnings in fflib and PETSc/SLEPc plugins Mar 25, 2026
Copilot finished work on behalf of prj- March 25, 2026 19:03
@prj- prj- marked this pull request as ready for review March 25, 2026 19:04
@prj- prj- changed the base branch from master to develop March 25, 2026 19:06
@prj- prj- force-pushed the copilot/fix-null-passed-to-callee branch from e1ec93f to e846e6b Compare March 25, 2026 19:06
@prj- prj- merged commit dea3472 into develop Mar 26, 2026
37 checks passed
@prj- prj- deleted the copilot/fix-null-passed-to-callee branch March 26, 2026 05:09
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.

2 participants