Browse Source

silence several compiler warnings

Wei Mingzhi 1 year ago
parent
commit
e8a57dcc09
2 changed files with 3 additions and 2 deletions
  1. 2 1
      unix/Makefile
  2. 1 1
      util.c

+ 2 - 1
unix/Makefile

@@ -49,7 +49,8 @@ endif
 
 CC = $(HOST)gcc
 CXX = $(HOST)g++
-CCFLAGS = `$(SDL_CONFIG) --cflags` -g -Wall -O2 -fno-strict-aliasing -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src -DPAL_HAS_PLATFORM_SPECIFIC_UTILS $(TEST_CCFLAGS) $(GENERATED)
+CCFLAGS = `$(SDL_CONFIG) --cflags` -D_GNU_SOURCE -g -Wall -O2 -fno-strict-aliasing -I. -I../ -I../liboggvorbis/include \
+	-I../liboggvorbis/src -DPAL_HAS_PLATFORM_SPECIFIC_UTILS $(TEST_CCFLAGS) $(GENERATED)
 CXXFLAGS = $(CCFLAGS) -std=c++11 $(FLTK_CXXFLAGS)
 CFLAGS = $(CCFLAGS) -std=gnu99 $(FLTK_CFLAGS)
 LDFLAGS = `$(SDL_CONFIG) --libs` $(FLTK_LDFLAGS) $(MIDI_LDFLAGS) -lstdc++ -lm -pthread

+ 1 - 1
util.c

@@ -586,7 +586,7 @@ UTIL_GetFullPathName(
 {
 	if (!buffer || !basepath || !subpath || buflen == 0) return NULL;
 
-	int baselen = strlen(basepath), sublen = strlen(subpath);
+	int sublen = strlen(subpath);
 	if (sublen == 0) return NULL;
 
 	char *_base = strdup(basepath), *_sub = strdup(subpath);