Actions
Bug #7498
openrust: cleanup of extern "C" functions and no_mangle
Affected Versions:
Effort:
Difficulty:
Label:
Description
I recently ran into an issue where a plugin was using a sha256 library that had a function names sha256_transform
. Suricata also has a function:
#[no_mangle] extern "C" fn sha256_finalize
The plugin was using our version leading to a crash.
On our side we should:
- only use no_mangle for pub extern "C"
, and these must be prefixed with "SC"
- if not pub, we shouldn't need no_mangle
, for example if the function is only ever used by pointer. We can let normal Rust mangling deal with it.
I plan to do this as a sweeping change.
Updated by Victor Julien 1 day ago
- Related to Story #7148: extensibility: plugins added
Actions