]> https://gitweb.dealii.org/ - dealii.git/commit
Fix a bogus warning about a null pointer in a lambda. 13289/head
authorDavid Wells <drwells@email.unc.edu>
Mon, 24 Jan 2022 21:08:41 +0000 (16:08 -0500)
committerDavid Wells <drwells@email.unc.edu>
Mon, 24 Jan 2022 21:09:44 +0000 (16:09 -0500)
commit2418d188615db18900ffbbfbb77ed1bc340a875c
treeb838c201d0a2bb500033eb67872968bae8efa945
parentea6e238cc62e3f628d1ff641339763581eb86dfd
Fix a bogus warning about a null pointer in a lambda.

I get the following warning:

/home/drwells/Documents/Code/CPP/dealii-dev/source/base/mpi.cc: In static member function 'static constexpr void dealii::Utilities::MPI::create_mpi_data_type_n_bytes(std::size_t)::<lambda(ompi_datatype_t**)>::_FUN(ompi_datatype_t**)':
/home/drwells/Documents/Code/CPP/dealii-dev/source/base/mpi.cc:384:15: warning: 'this' pointer is null [-Wnonnull]
  384 |               }};
      |               ^
/home/drwells/Documents/Code/CPP/dealii-dev/source/base/mpi.cc:376:15: note: in a call to non-static member function 'dealii::Utilities::MPI::create_mpi_data_type_n_bytes(std::size_t)::<lambda(ompi_datatype_t**)>'
  376 |               [](MPI_Datatype *p) {
      |               ^

This isn't a problem since deleters don't store any kind of state but we can
work around it by splitting the constructor call.
source/base/mpi.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.