[Add] Using -Wpointer-arith flag.

This commit is contained in:
Allanis 2013-06-28 13:23:01 +01:00
parent 14fed140c3
commit 5eff5317c6
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ ifeq ($(OS),LINUX)
CFLAGS += -D_POSIX_SOURCE
endif
ifdef DEBUG
CFLAGS += -W -Wall -Wextra -Wmissing-prototypes -Winline -Wcast-align \
CFLAGS += -W -Wall -Wextra -Wpointer-arith -Wmissing-prototypes -Winline -Wcast-align \
-Wmissing-declarations -fno-inline -g3 -DDEBUG -DLUA_USE_APICHECK -std=c99
else
CFLAGS += -O2 -funroll-loops -pipe -std=c99

View File

@ -382,6 +382,7 @@ long pack_tell(Packfile* file) {
void* pack_readfile(const char* packfile, const char* filename, uint32_t* filesize) {
Packfile* file = (Packfile*)malloc(sizeof(Packfile));
void* buf;
char* str;
int size, bytes;
if(filesize)
@ -409,7 +410,8 @@ void* pack_readfile(const char* packfile, const char* filename, uint32_t* filesi
return NULL;
}
DEBUG("Read %d bytes from '%s'", bytes, filename);
memset(buf+size, 0, 1); /* Append size '\0' for it to validate as a string. */
str = buf;
str[size] = '\0'; /* Append size '\0' for it to validate as a string. */
/* Check the md5. */
md5_state_t md5;