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

ci: fix and test with Wunused-macros #10808

Closed

Conversation

catenacyber
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6937

Describe changes:

  • Remove unused macros as reported by compiler with -Wunused-macros and test in CI with default C flags

#10804 which should be good for CI

@suricata-qa
Copy link

WARNING:

field baseline test %
build_asan

Pipeline 20015

Comment on lines 80 to 83
struct bpf_program {
unsigned int bf_len;
struct bpf_insn *bf_insns;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should not, but this is include hell :
bpf_program may be defined by both kernel bpf.h and by libpcap pcap.h (and other like bpf_insn)
So, we should only be using either pcap or bpf in each C file, but this is not the case here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bpf.h is needed for bpf_map_update_elem(mapd, key, value, BPF_NOEXIST)

pcap.h is needed for PCAP_ERRBUF_SIZE and SCBPFCompile

@catenacyber catenacyber force-pushed the compile-wunused-macros-6937-v2 branch 2 times, most recently from a76427b to ad9f8c5 Compare April 12, 2024 07:31
@catenacyber catenacyber marked this pull request as draft April 12, 2024 07:32
@catenacyber catenacyber force-pushed the compile-wunused-macros-6937-v2 branch from ad9f8c5 to 4c84c1d Compare April 12, 2024 07:43
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 82.66%. Comparing base (d9148d1) to head (4c84c1d).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10808      +/-   ##
==========================================
- Coverage   82.73%   82.66%   -0.07%     
==========================================
  Files         927      928       +1     
  Lines      247785   247914     +129     
==========================================
- Hits       204996   204947      -49     
- Misses      42789    42967     +178     
Flag Coverage Δ
fuzzcorpus 64.00% <83.33%> (-0.18%) ⬇️
suricata-verify 61.99% <66.66%> (+0.01%) ⬆️
unittests 62.18% <66.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@catenacyber
Copy link
Contributor Author

Replaced by #10814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants