bgpd,lib,zebra: use explicit casts in tracepoint definitions - #21438
Conversation
prefix.macip_addr.eth_tag used as a pointer, but actually an int. Signed-off-by: Mark Stapp <mjs@cisco.com>
Greptile SummaryThis PR adds explicit Key changes:
Confidence Score: 5/5Safe to merge β all changes are mechanical explicit casts plus one genuine bug fix in a tracepoint. All modifications are straightforward pointer-to-intptr_t casts required by GCC 14's stricter implicit-conversion rules. The only behavioral change is the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tracepoint macro invoked\ne.g. ctf_integer_hex] --> B{Argument type}
B -->|void* / struct ptr| C["Before: implicit ptrβintptr_t\nβ GCC 14 warning"]
B -->|void* / struct ptr| D["After: explicit (intptr_t) cast\nβ
No warning"]
B -->|struct event **| E["After: (intptr_t)(void*)(*thread_ptr)\nβ
Correct aliasing"]
B -->|uint32_t field eth_tag bug| F["Before: &field (address)\nπ Wrong value logged"]
F --> G["After: field (value)\nβ
Correct eth_tag logged"]
D --> H[LTTng tracepoint recorded]
E --> H
G --> H
Reviews (1): Last reviewed commit: "bgpd,lib,zebra: cast pointers to intptr_..." | Re-trigger Greptile |
Cast pointers in tracepoint arguments to intptr_t explicitly to keep compilers happy. Signed-off-by: Mark Stapp <mjs@cisco.com>
b0b4531 to
689d29b
Compare
|
fixed a checkpatch warning |
gcc 14 doesn't like some of the implicit casting in the tracepoint macros: cast pointers in tracepoint arguments to intptr_t explicitly to keep compilers happy. Also fix a bug in a bgp tracepoint.