[Add] Using -Wpointer-arith flag.
This commit is contained in:
parent
14fed140c3
commit
5eff5317c6
@ -29,7 +29,7 @@ ifeq ($(OS),LINUX)
|
|||||||
CFLAGS += -D_POSIX_SOURCE
|
CFLAGS += -D_POSIX_SOURCE
|
||||||
endif
|
endif
|
||||||
ifdef DEBUG
|
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
|
-Wmissing-declarations -fno-inline -g3 -DDEBUG -DLUA_USE_APICHECK -std=c99
|
||||||
else
|
else
|
||||||
CFLAGS += -O2 -funroll-loops -pipe -std=c99
|
CFLAGS += -O2 -funroll-loops -pipe -std=c99
|
||||||
|
@ -382,6 +382,7 @@ long pack_tell(Packfile* file) {
|
|||||||
void* pack_readfile(const char* packfile, const char* filename, uint32_t* filesize) {
|
void* pack_readfile(const char* packfile, const char* filename, uint32_t* filesize) {
|
||||||
Packfile* file = (Packfile*)malloc(sizeof(Packfile));
|
Packfile* file = (Packfile*)malloc(sizeof(Packfile));
|
||||||
void* buf;
|
void* buf;
|
||||||
|
char* str;
|
||||||
int size, bytes;
|
int size, bytes;
|
||||||
|
|
||||||
if(filesize)
|
if(filesize)
|
||||||
@ -409,7 +410,8 @@ void* pack_readfile(const char* packfile, const char* filename, uint32_t* filesi
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
DEBUG("Read %d bytes from '%s'", bytes, filename);
|
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. */
|
/* Check the md5. */
|
||||||
md5_state_t md5;
|
md5_state_t md5;
|
||||||
|
Loading…
Reference in New Issue
Block a user