Open lars18th opened 1 year ago
We should consider turning warnings into errors and fix everything
We should consider turning warnings into errors and fix everything
This could have sense in the testing phase of the workflow build.yml
, right? So, we can add more compilers to check them.
Anyway, you want to fix these small warnings?
This could have sense in the testing phase of the workflow build.yml, right? So, we can add more compilers to check them. Basically, yes. Anyway, you want to fix these small warnings? Sure why not
More warnings,
In this case with GCC 12.2 running inside the Docker image builder for ARM target
In file included from utils.h:5,
from utils.c:24:
utils.c: In function 'myrealloc':
utils/logging/logging.h:38:13: warning: pointer 'p' may be used after 'realloc' [-Wuse-after-free]
38 | _log(__FILE__, __LINE__, a, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
utils/logging/logging.h:41:22: note: in expansion of macro 'LOGL'
41 | #define LOGM(a, ...) LOGL(DEFAULT_LOG, a, ##__VA_ARGS__)
| ^~~~
utils.c:388:5: note: in expansion of macro 'LOGM'
388 | LOGM("%s:%d allocation_wrapper realloc allocated %d bytes from %p -> %p", f,
| ^~~~
utils.c:385:15: note: call to 'realloc' here
385 | void *x = realloc(p, a);
| ^~~~~~~~~~~~~
These detected compiling with GCC 12.2 for MIPS:
utils.c: In function 'print_trace':
utils.c:246:5: warning: implicit declaration of function 'backtrace' [-Wimplicit-function-declaration]
size = backtrace(array, 10);
^
utils.c: In function '_strncpy':
utils.c:860:9: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
#pragma GCC diagnostic ignored "-Wstringop-truncation"
^
[...]
satipc.c: In function 'satipc_read':
satipc.c:688:12: warning: missing braces around initializer [-Wmissing-braces]
struct mmsghdr messages[MAX_RTP_MSG] = {0};
^
satipc.c:688:12: warning: (near initialization for 'messages[0]') [-Wmissing-braces]
satipc.c:690:9: warning: missing braces around initializer [-Wmissing-braces]
0}; // RTP Header + Payload (up to 1316 bytes) for each UDP datagram
^
satipc.c:690:9: warning: (near initialization for 'iovs[0]') [-Wmissing-braces]
I feel some of the warnings doesn't have sense to fix, because it complicates the code and they aren't errors. However, if someone wants to update the code then no problem. I've fixed some in the PR #1115
Hi @catalinii ,
Please, review your change of https://github.com/catalinii/minisatip/commit/8d33e939b820fef824c84a92dd6affcd455bbf55 becuase it has broken the automatic checking of patches, like this https://github.com/catalinii/minisatip/actions/runs/5242026172/jobs/9464892586?pr=1119 .
Thank you.
I hope to fix the binaries generation with zig in max 1 werk
FYI,
Compiling with
zig cc
andEMBEDDED=1
: