]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add UNUSED_ATTR to ZSTD_storeSeq() 1804/head
authorNick Terrell <nickrterrell@gmail.com>
Sat, 21 Sep 2019 04:37:13 +0000 (21:37 -0700)
committerNick Terrell <nickrterrell@gmail.com>
Sat, 21 Sep 2019 04:37:13 +0000 (21:37 -0700)
lib/common/compiler.h
lib/compress/zstd_compress_internal.h

index 36584aa698397d4d0ea516e392d61095fa6ee295..1877a0c1d9be02168dfff4afac4000483f950f61 100644 (file)
 #  define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR
 #endif
 
+/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */
+#if defined(__GNUC__)
+#  define UNUSED_ATTR __attribute__((unused))
+#else
+#  define UNUSED_ATTR
+#endif
+
 /* force no inlining */
 #ifdef _MSC_VER
 #  define FORCE_NOINLINE static __declspec(noinline)
index 42660e1e029e1294fe99db8001f179356acbc2b1..1140945b1e99768a16b7f91dd5cd54805a62d666 100644 (file)
@@ -361,7 +361,8 @@ static void ZSTD_safecopyLiterals(BYTE* op, BYTE const* ip, BYTE const* const ie
  *  `mlBase` : matchLength - MINMATCH
  *  Allowed to overread literals up to litLimit.
 */
-HINT_INLINE void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const BYTE* literals, const BYTE* litLimit, U32 offCode, size_t mlBase)
+HINT_INLINE UNUSED_ATTR
+void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const BYTE* literals, const BYTE* litLimit, U32 offCode, size_t mlBase)
 {
     BYTE const* const litLimit_w = litLimit - WILDCOPY_OVERLENGTH;
     BYTE const* const litEnd = literals + litLength;