]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
updated tests for zlibwrapper C90 strict compatibility
authorYann Collet <cyan@fb.com>
Thu, 3 Oct 2019 00:32:19 +0000 (17:32 -0700)
committerYann Collet <cyan@fb.com>
Thu, 3 Oct 2019 00:32:19 +0000 (17:32 -0700)
zlibWrapper/Makefile
zlibWrapper/gzlib.c

index 4ef180282573263c40a3279c80e5e2854f3d2fe0..f8ade82821c3abe2b7086c7c461c1533aa905305 100644 (file)
@@ -18,15 +18,15 @@ EXAMPLE_PATH = examples
 PROGRAMS_PATH = ../programs
 TEST_FILE = ../doc/zstd_compression_format.md
 
-CPPFLAGS = -DXXH_NAMESPACE=ZSTD_ -I$(ZLIB_PATH) -I$(PROGRAMS_PATH)      \
-           -I$(ZSTDLIBDIR) -I$(ZSTDLIBDIR)/common -I$(ZLIBWRAPPER_PATH)
-STDFLAGS = -std=c90 -pedantic -Wno-long-long -Wno-variadic-macros -Wc++-compat
-DEBUGFLAGS=-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
-           -Wdeclaration-after-statement -Wstrict-prototypes -Wundef     \
-           -Wstrict-aliasing=1
-CFLAGS  ?= -O3
-CFLAGS  += $(STDFLAGS) $(DEBUGFLAGS) $(MOREFLAGS)
-
+CPPFLAGS += -DXXH_NAMESPACE=ZSTD_ -I$(ZLIB_PATH) -I$(PROGRAMS_PATH)       \
+            -I$(ZSTDLIBDIR) -I$(ZSTDLIBDIR)/common -I$(ZLIBWRAPPER_PATH)
+STDCFLAGS = -std=c90 -pedantic -Wno-long-long -Wno-variadic-macros -Wc++-compat \
+            -DNO_snprintf -DNO_vsnprintf  # strict ISO C90 is missing these prototypes
+DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
+            -Wdeclaration-after-statement -Wstrict-prototypes -Wundef     \
+            -Wstrict-aliasing=1
+CFLAGS   ?= -O3
+CFLAGS   += $(STDFLAGS) $(DEBUGFLAGS) $(MOREFLAGS)
 
 # Define *.exe as extension for Windows systems
 ifneq (,$(filter Windows%,$(OS)))
@@ -35,6 +35,11 @@ else
 EXT =
 endif
 
+default : release
+
+release : STDFLAGS =
+release : STDCPPFLAGS =
+release : all
 
 all: fitblk example zwrapbench minigzip
 
index b004e4f30160b08a2405917928bb278c13f1dd01..b1fb98517e4da9e4cacd721613334a765a54bb91 100644 (file)
@@ -216,7 +216,7 @@ local gzFile gz_open(path, fd, mode)
 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
         (void)snprintf(state.state->path, len + 1, "%s", (const char *)path);
 #else
-        strcpy(state.state->path, path);
+        strcpy(state.state->path, (const char*)path);
 #endif
 
     /* compute the flags for open() */