mirror of
https://github.com/merbanan/rtl_433.git
synced 2026-06-11 02:25:24 -04:00
minor: Fix some GCC false-positive warnings
This commit is contained in:
@@ -153,6 +153,7 @@ alloc_error:
|
||||
|
||||
// the static analyzer can't prove the allocs to be correct
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
|
||||
|
||||
|
||||
@@ -148,10 +148,16 @@ static int header_to_raw(mtar_raw_header_t *rh, const mtar_header_t *h) {
|
||||
snprintf(rh->size, sizeof(rh->size), "%011o", h->size);
|
||||
snprintf(rh->mtime, sizeof(rh->mtime), "%011o", h->mtime);
|
||||
rh->type = h->type ? h->type : MTAR_TREG;
|
||||
/* TAR does not need fields to be zero terminated */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
strncpy(rh->name, h->name, sizeof(rh->name));
|
||||
strncpy(rh->linkname, h->linkname, sizeof(rh->linkname));
|
||||
strncpy(rh->uname, h->uname, sizeof(rh->uname));
|
||||
strncpy(rh->gname, h->gname, sizeof(rh->gname));
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
memcpy(rh->magic, TMAGIC, TMAGLEN);
|
||||
memcpy(rh->version, TVERSION, TVERSLEN);
|
||||
|
||||
@@ -99,6 +99,12 @@ double arg_float(char const *str, char const *error_hint)
|
||||
return val;
|
||||
}
|
||||
|
||||
// GCC'S analyzer has a false-positive on strchr() here
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma GCC diagnostic ignored "-Wanalyzer-deref-before-check"
|
||||
|
||||
char *hostport_param(char *param, char const **host, char const **port)
|
||||
{
|
||||
if (param && *param) {
|
||||
@@ -133,6 +139,8 @@ char *hostport_param(char *param, char const **host, char const **port)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
uint32_t atouint32_metric(char const *str, char const *error_hint)
|
||||
{
|
||||
if (!str) {
|
||||
|
||||
@@ -958,6 +958,7 @@ static int sdr_open_soapy(sdr_dev_t **out_dev, char const *dev_query, int verbos
|
||||
|
||||
// the buffer sizes can't be proven to be correct
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma GCC diagnostic ignored "-Wanalyzer-allocation-size"
|
||||
|
||||
|
||||
@@ -404,9 +404,14 @@ int sigmf_reader_open(sigmf_t *sigmf, char const *path)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Mangle stream name
|
||||
// Mangle stream name, replace ".sigmf-meta" extension with ".data" extension
|
||||
size_t name_len = strlen(stream_name);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
strncpy(stream_name + name_len - 4, "data", 4);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// Load and print contents of file "foo.sigmf-data"
|
||||
// NOTE: finds the first instance but should theoretically use the last one
|
||||
|
||||
Reference in New Issue
Block a user