Skip to content

dnsdist: Warning when building the BPF filter code on CentOS 8 #10988

@rgacogne

Description

@rgacogne
  • Program: dnsdist
  • Issue type: Bug report

Short description

I just saw these warnings in the CentOS 8 build log:

bpf-filter.cc:50:5: warning: no previous declaration for 'int bpf_pin_map(int, const string&)' [-Wmissing-declarations]
 int bpf_pin_map(int fd, const std::string& path)
     ^~~~~~~~~~~
bpf-filter.cc:59:5: warning: no previous declaration for 'int bpf_load_pinned_map(const string&)' [-Wmissing-declarations]
 int bpf_load_pinned_map(const std::string& path)
     ^~~~~~~~~~~~~~~~~~~
bpf-filter.cc:67:6: warning: no previous declaration for 'void bpf_check_map_sizes(int, uint32_t, uint32_t)' [-Wmissing-declarations]
 void bpf_check_map_sizes(int fd, uint32_t expectedKeySize, uint32_t expectedValueSize)
      ^~~~~~~~~~~~~~~~~~~
bpf-filter.cc: In member function 'void BPFFilter::block(const DNSName&, BPFFilter::MatchAction, uint16_t)':
bpf-filter.cc:478:42: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct CounterAndActionValue'; use assignment or value-initialization instead [-Wclass-memaccess]
     memset(&cadvalue, 0, sizeof(cadvalue));
                                          ^
bpf-filter.cc:192:8: note: 'struct CounterAndActionValue' declared here
 struct CounterAndActionValue
        ^~~~~~~~~~~~~~~~~~~~~
bpf-filter.cc:484:38: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct QNameValue'; use assignment or value-initialization instead [-Wclass-memaccess]
     memset(&qvalue, 0, sizeof(qvalue));
                                      ^
bpf-filter.cc:186:8: note: 'struct QNameValue' declared here
 struct QNameValue
        ^~~~~~~~~~

I will have to fix these before 1.7.0 final.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions