Open TomTheBear opened 2 months ago
Removes some compiler warnings
Thanks for the PR. Can you please add to the description the OS and compiler on which u get the warning.
Also, Can u check the formatting error.
It's an Ubuntu 22.04 system with GCC 11.4.0 but I use a custom Makefile
. My cmake
knowledge is so limited, I cannot even add -Wall
to the configuration.
It is basically just a single compiler warning:
/home/unrz139/Work/GOTCHA.orig/src/libc_wrappers.c: In function ‘gotcha_malloc’:
/home/unrz139/Work/GOTCHA.orig/src/libc_wrappers.c:72:41: warning: ‘best_fit_diff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
72 | if (diff >= 0 && (!best_fit || diff < best_fit_diff)) {
| ~~~~~^~~~~~~~~~~~~~~
But after I started, I checked all occurrences of variables that are not initialized in the beginning of a function. Most of them are set later and do not cause warnings. Makefile.txt
Removes some compiler warnings