From 8b1d004031b2b78b535b6ce369510e1b91f87cc3 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sun, 5 Mar 2017 21:17:32 -0800 Subject: [PATCH] added -Wformat-security flag, as recommended by @pixelb --- Makefile | 6 +++++- NEWS | 1 + lib/Makefile | 2 +- programs/Makefile | 2 +- tests/Makefile | 5 +++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0f97e6c5..f0492d94 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ EXT = endif .PHONY: default -default: lib zstd-release +default: lib-release zstd-release .PHONY: all all: | allmost examples manual @@ -42,6 +42,10 @@ all32: .PHONY: lib lib: + @$(MAKE) -C $(ZSTDDIR) $@ + +.PHONY: lib-release +lib-release: @$(MAKE) -C $(ZSTDDIR) .PHONY: zstd diff --git a/NEWS b/NEWS index 760724a2..9073a872 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ arch : 32-bits variant able to generate and decode very long matches (>32 MB), b API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize() build: new: meson build system in contrib/meson, by Dima Krasner build: improved cmake script, by @Majlen +build: added -Wformat-security flag, as recommended by Padraig Brady doc : new : educational decoder, by Sean Purcell v1.1.3 diff --git a/lib/Makefile b/lib/Makefile index 05dd2bc9..58f99baf 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -24,7 +24,7 @@ CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_ CFLAGS ?= -O3 DEBUGFLAGS = -g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ - -Wstrict-prototypes -Wundef -Wpointer-arith + -Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) diff --git a/programs/Makefile b/programs/Makefile index 407a4f37..5620a25a 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -30,7 +30,7 @@ CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ CFLAGS ?= -O3 DEBUGFLAGS = -g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ - -Wstrict-prototypes -Wundef -Wpointer-arith + -Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) diff --git a/tests/Makefile b/tests/Makefile index 88c58fce..8b19aa3d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -28,8 +28,9 @@ TESTARTEFACT := versionsTest namespaceTest CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) CFLAGS ?= -O3 -CFLAGS += -g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \ - -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef +CFLAGS += -g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef -Wformat-security CFLAGS += $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)