Skip to content

Commit

Permalink
Makefile: Add -Werror
Browse files Browse the repository at this point in the history
Also cleanup things revealed via adding -Werror :-)

Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
  • Loading branch information
tuckerpo-cl committed Oct 31, 2022
1 parent ae353fd commit feba737
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
appname := pcap_rt

CXX := g++
CXXFLAGS := -Wall -std=c++17
CXXFLAGS := -Wall -Werror -std=c++17

srcfiles := $(shell find . -maxdepth 1 -name "*.cpp")
objects := $(patsubst %.cpp, %.o, $(srcfiles))
Expand Down
3 changes: 1 addition & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static std::vector<uint8_t *> whitelisted_macs;

static std::vector<station> stations;

static void stop_collecting_metrics(uint8_t mac[ETH_ALEN])
[[maybe_unused]] static void stop_collecting_metrics(uint8_t mac[ETH_ALEN])
{
bool found = std::find_if(stations.begin(), stations.end(), [&mac](const station &s) {
return std::memcmp(mac, s.get_mac().data(), ETH_ALEN);
Expand Down Expand Up @@ -161,7 +161,6 @@ static void station_keepalive_check(std::vector<station> &station_list,
static void packet_cb(u_char *args, const struct pcap_pkthdr *pcap_hdr, const u_char *packet)
{
int err;
int i;
struct ieee80211_radiotap_iterator iter;
if (!stay_alive)
pcap_breakloop((pcap_t *)args);
Expand Down
3 changes: 1 addition & 2 deletions station.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

station::station(uint8_t mac[ETH_ALEN])
{
for (int i = 0; i < ETH_ALEN; i++)
for (size_t i = 0; i < ETH_ALEN; i++)
m_mac[i] = mac[i];
}

Expand Down Expand Up @@ -48,7 +48,6 @@ void station::calculate_wma()
auto now = std::chrono::system_clock::now();

int32_t rssi_sum = 0;
int i = 0;
int denom = 0;

for (const auto &measurement : m_rssi_measurements) {
Expand Down

0 comments on commit feba737

Please sign in to comment.