Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libspdm: add extern fn type checking
We don't generate errors or warnings if the function signatures we implement don't match the version in libspdm. So far this has been ok as libspdm only appended arguments, but in the future this could cause breakages. There doesn't appear to be any reasonable way to assert that our function matches the bindgen version. This patch adds a macro that can compare a provided function type, to it's bindgen generated type upon expansion. When using this macro, the first argument shall specify the local type, that is, the type of the function as defined within `spdm-utils`. Upon expansion, the macro will type check bindgen generated function against the provided type. All of this shall run only in a `test` context, with no runtime overhead. CI should catch any future failures if `libspdm` has changed. Signed-off-by: Alistair Francis <[email protected]> Signed-off-by: Wilfred Mallawa <[email protected]>
- Loading branch information