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

Ubuntu 22.04 PETSC 3.19.6 compiler warnings #263

Closed
fcooper8472 opened this issue Apr 29, 2024 · 2 comments
Closed

Ubuntu 22.04 PETSC 3.19.6 compiler warnings #263

fcooper8472 opened this issue Apr 29, 2024 · 2 comments

Comments

@fcooper8472
Copy link
Member

Warnings are now emitted since PETSC 3.19:

[ 66%] Building CXX object global/CMakeFiles/chaste_global.dir/src/fortests/PetscSetupUtils.cpp.o
/home/fcooper/GitRepos/Chaste/Chaste/global/src/fortests/PetscSetupUtils.cpp:80:13: warning: PETSC_NULL is deprecated, use PETSC_NULLPTR instead (since version 3.19)
   80 |     PETSCEXCEPT(PetscInitialize(p_args->p_argc, p_args->p_argv, PETSC_NULL, PETSC_NULL));
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This appears to have only been introduced in 3.17, so we will need to (for instance) make it a PETSC version-specific macro in a new header file.

@fcooper8472
Copy link
Member Author

fcooper8472 commented Apr 29, 2024

Something along these lines:

// Use PETSC_NULLPTR for PETSc 3.19 and later, and PETSC_NULL for older versions
#if PETSC_VERSION_GE(3, 19, 0)
    #define CHASTE_PETSC_NULLPTR PETSC_NULLPTR
#else
    #define CHASTE_PETSC_NULLPTR PETSC_NULL
#endif

@fcooper8472
Copy link
Member Author

Closed by #276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants