Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aivarsk committed Jul 30, 2021
1 parent fb65026 commit 9d11399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BBL.cpp
Expand Up @@ -104,7 +104,7 @@ static void run_watchdog() {
}
}

int tpsvrinit(int argc, char *argv[]) {
int tpsvrinit(int, char *[]) {
std::thread t(run_watchdog);
t.detach();
return 0;
Expand Down
6 changes: 6 additions & 0 deletions src/mem.cpp
Expand Up @@ -73,9 +73,15 @@ char *tpalloc(char *type, char *subtype, long size) {

size = size >= tptype->default_size ? size : tptype->default_size;
auto mem = (tpmem *)malloc(sizeof(tpmem) + size);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(mem->type, type, sizeof(mem->type));
#pragma GCC diagnostic pop
if (subtype != nullptr) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(mem->subtype, subtype, sizeof(mem->subtype));
#pragma GCC diagnostic pop
} else {
mem->subtype[0] = '\0';
}
Expand Down
2 changes: 1 addition & 1 deletion src/mib.cpp
Expand Up @@ -334,7 +334,7 @@ const char *to_string(state_t s) {
}
}

state_t to_state(const std::string_view &s) { return state_t::undefined; }
state_t to_state(const std::string_view &) { return state_t::undefined; }

const char *to_string(bool b) {
if (b) {
Expand Down

0 comments on commit 9d11399

Please sign in to comment.