Project

General

Profile

Actions

Optimization #4517

open

cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1), and remove duplicate definitions between rust and C

Added by Philippe Antoine almost 3 years ago. Updated 10 months ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

So that we do not have 2 definitions on the 2 sides
Which can end up having a different value
cf https://github.com/OISF/suricata/pull/6168

That is the line item_types = ["enums","structs","opaque","functions"] in rust/cbindgen.toml

cbindgen doesn't like our BIT_ macros, maybe there is a work-around, maybe not. In Rust bit flags are often written out like 0b00000001.

This would lead us more to a big super include. Should we care? I noticed I can run cbindgen aginst particular .rs files to make more granular header files which might be something to explore as well...


Related issues 1 (0 open1 closed)

Related to Suricata - Bug #5012: Remove duplicate definition of constants between C and RustClosedActions
Actions

Also available in: Atom PDF