Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Fix compilation warning for rfapi code #17454

Conversation

ton31337
Copy link
Member

No description provided.

bgpd/rfapi/rfapi_rib.c:1800:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
         prefix_time = (time_t)trn->info;

Signed-off-by: Donatas Abraitis <[email protected]>
Copy link
Member

@donaldsharp donaldsharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not believe this is correct, here is where the trn->info pointer is set:

trn->info = (void *)(uintptr_t)monotime(NULL);

effectively they are taking a uint64_t and treating it as a pointer. Your code is dereferencing that pointer right?

@ton31337 ton31337 closed this Nov 19, 2024
@ton31337 ton31337 deleted the fix/compile_warning_time_t_casting branch November 19, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants