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

p4-ebpf: Fix warnings generated by clang when compiling XDP helper program #3322

Merged
merged 1 commit into from
May 13, 2022

Conversation

osinstom
Copy link
Contributor

Currently, clang generates the following warnings when compiling XDP helper program:

out.c:313:26: warning: cast to 'struct ethhdr *' from smaller integer type '__u32' (aka 'unsigned int') [-Wint-to-pointer-cast] 
   struct ethhdr *eth = (struct ethhdr *) skb->data;
                        ^ 
out.c:329:60: warning: cast to 'void *' from smaller integer type '__u32' (aka 'unsigned int') [-Wint-to-void-pointer-cast]                                                                              
   if ((void *) ((struct internal_metadata *) meta + 1) > (void *) skb->data)
                                                          ^ 
2 warnings generated.   

They don't impact the functionality, but might be annoying for users. This PR fixes the XDP helper program.

Copy link

@mestery mestery left a comment

Choose a reason for hiding this comment

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

LGTM

@mihaibudiu mihaibudiu merged commit 771c7aa into p4lang:main May 13, 2022
github-sajan pushed a commit to github-sajan/p4c that referenced this pull request May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants