Enable -pedantic and fix use of %p with non-void* pointers

This commit is contained in:
Tor Arne Vestbø
2018-05-04 00:23:24 +02:00
parent 53ca0a682b
commit d500e0c37b
2 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
TARGET = sparsebundlefs
PKG_CONFIG = pkg-config
override CFLAGS += -std=c++11 -Wall -O2 -g
override CFLAGS += -std=c++11 -Wall -pedantic -O2 -g
GCC_4_2_OR_HIGHER := $(shell expr `$(CXX) -dumpversion | sed 's/\.//g'` \>= 420)
ifeq "$(GCC_4_2_OR_HIGHER)" "1"

View File

@@ -196,7 +196,7 @@ static int sparsebundle_read_process_band(const char *band_path, size_t length,
char** buffer = static_cast<char**>(read_data);
syslog(LOG_DEBUG, "reading %zu bytes at offset %ju into %p",
length, uintmax_t(offset), *buffer);
length, uintmax_t(offset), static_cast<void *>(*buffer));
int band_file = open(band_path, O_RDONLY);
if (band_file != -1) {
@@ -221,7 +221,8 @@ static int sparsebundle_read_pad_with_zeroes(size_t length, void *read_data)
{
char** buffer = static_cast<char**>(read_data);
syslog(LOG_DEBUG, "padding %zu bytes of zeroes into %p", length, *buffer);
syslog(LOG_DEBUG, "padding %zu bytes of zeroes into %p",
length, static_cast<void *>(*buffer));
memset(*buffer, 0, length);
*buffer += length;