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

Handle duplicate function definitions in .c files guarded by macro guards #35

Open
palanik1 opened this issue Dec 12, 2022 · 0 comments
Assignees
Labels
Extraction Extracting code from monoliths help wanted Extra attention is needed question Further information is requested

Comments

@palanik1
Copy link
Member

palanik1 commented Dec 12, 2022

Is your feature request related to a problem? Please describe.
Consider sock4_update_revnat in cilium/bpf_sock.c defined at line numbers 168 and 193 in the same file. Currently, the developer has to pick one. By default, if there are multiple defs, we process the first definition.
Three alternatives are:

  1. Possibly alert developer and exit processing.
  2. Pick first defn as current practice
  3. Pick all definitions and protect with macro guards. In principle this should work, since this is already done while extracting functions.

This is not an issue with .h files, since we include them as is. I think the single function definition requirement matters only when there are multiple defns across different files.

@palanik1 palanik1 added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed question Further information is requested and removed bug Something isn't working enhancement New feature or request labels Dec 12, 2022
@sdsen sdsen added the Extraction Extracting code from monoliths label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extraction Extracting code from monoliths help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants