From 71ffd88c4231c23dc3291e363d8422a9724f02ee Mon Sep 17 00:00:00 2001 From: senhuang42 Date: Thu, 13 May 2021 12:39:02 -0400 Subject: [PATCH] Add source level deprecation warning disabling to certain tests/utils --- build/meson/contrib/pzstd/meson.build | 2 +- build/meson/tests/meson.build | 2 +- contrib/pzstd/Options.h | 3 +++ contrib/pzstd/Pzstd.h | 3 +++ tests/fullbench.c | 1 + tests/fuzzer.c | 1 + tests/zstreamtest.c | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/meson/contrib/pzstd/meson.build b/build/meson/contrib/pzstd/meson.build index 8f3822fd776..dcf2136db43 100644 --- a/build/meson/contrib/pzstd/meson.build +++ b/build/meson/contrib/pzstd/meson.build @@ -18,7 +18,7 @@ pzstd_sources = [join_paths(zstd_rootdir, 'programs/util.c'), join_paths(zstd_rootdir, 'contrib/pzstd/SkippableFrame.cpp')] pzstd = executable('pzstd', pzstd_sources, - cpp_args: [ '-DNDEBUG', '-Wno-shadow', '-pedantic' ], + cpp_args: [ '-DNDEBUG', '-Wno-shadow', '-pedantic', '-Wno-deprecated-declarations' ], include_directories: pzstd_includes, dependencies: [ libzstd_dep, thread_dep ], install: true) diff --git a/build/meson/tests/meson.build b/build/meson/tests/meson.build index 0587f9a70d5..1b233630a07 100644 --- a/build/meson/tests/meson.build +++ b/build/meson/tests/meson.build @@ -57,7 +57,7 @@ fuzzer_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'), fuzzer = executable('fuzzer', fuzzer_sources, include_directories: test_includes, - dependencies: libzstd_dep, + dependencies: [ libzstd_dep, thread_dep ], install: false) zstreamtest_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'), diff --git a/contrib/pzstd/Options.h b/contrib/pzstd/Options.h index f4f2aaa499c..924543abfd5 100644 --- a/contrib/pzstd/Options.h +++ b/contrib/pzstd/Options.h @@ -9,6 +9,9 @@ #pragma once #define ZSTD_STATIC_LINKING_ONLY +#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, pzstd itself is deprecated + * and uses deprecated functions + */ #include "zstd.h" #undef ZSTD_STATIC_LINKING_ONLY diff --git a/contrib/pzstd/Pzstd.h b/contrib/pzstd/Pzstd.h index 033adefaf3a..c667c887d7b 100644 --- a/contrib/pzstd/Pzstd.h +++ b/contrib/pzstd/Pzstd.h @@ -17,6 +17,9 @@ #include "utils/ThreadPool.h" #include "utils/WorkQueue.h" #define ZSTD_STATIC_LINKING_ONLY +#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, pzstd itself is deprecated + * and uses deprecated functions + */ #include "zstd.h" #undef ZSTD_STATIC_LINKING_ONLY diff --git a/tests/fullbench.c b/tests/fullbench.c index b0efe7e15ab..f3cd8269e5f 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -28,6 +28,7 @@ #define GB *(1U<<30) typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e; #endif +#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, we still bench some deprecated functions */ #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressBegin, ZSTD_compressContinue, etc. */ #include "zstd.h" /* ZSTD_versionString */ #include "util.h" /* time functions */ diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 0a9cb7c2a7c..1ea65210d03 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -30,6 +30,7 @@ #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressContinue, ZSTD_compressBlock */ #include "debug.h" /* DEBUG_STATIC_ASSERT */ #include "fse.h" +#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, we still test some deprecated functions */ #include "zstd.h" /* ZSTD_VERSION_STRING */ #include "zstd_errors.h" /* ZSTD_getErrorCode */ #define ZDICT_STATIC_LINKING_ONLY diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index 56f77232fe9..bbef903f892 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -28,6 +28,7 @@ #include /* assert */ #include "timefn.h" /* UTIL_time_t, UTIL_getTime */ #include "mem.h" +#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, we still test some deprecated functions */ #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_maxCLevel, ZSTD_customMem, ZSTD_getDictID_fromFrame */ #include "zstd.h" /* ZSTD_compressBound */ #include "zstd_errors.h" /* ZSTD_error_srcSize_wrong */