openPMD SetupMeshComponent header declaration does not match definition
I/Ocode-audit
# openPMD `SetupMeshComponent` header declaration does not match definition
**Severity:** Low
**File:** `src/io/openPMD.hpp:30` vs `src/io/openPMD.cpp:57`
## Explanation
The header declares:
```cpp
void SetupMeshComponent(openPMD::Mesh &mesh, int /*meshLevel*/, const std::string &comp_name, amrex::Geometry &full_geom);
```
(4 parameters), but the `.cpp` defines:
```cpp
void SetupMeshComponent(openPMD::Mesh &mesh, amrex::Geometry &full_geom) { ... }
```
(2 parameters). These are two different functions. The 4-arg version is
declared but never defined; any caller that includes the header and tries to
use `SetupMeshComponent` will hit a linker error (undefined reference) or a
compile error (no matching 2-arg overload visible). The sole call site in
`openPMD.cpp:117` uses the 2-arg form and works only because the `.cpp` doesn't
include the `.hpp`. The `int meshLevel` and `comp_name` parameters appear to
have been removed from the implementation without updating the header.
## Proposed patch
In `openPMD.hpp:30`:
```cpp
void SetupMeshComponent(openPMD::Mesh &mesh, amrex::Geometry &full_geom);
```
0 条评论