From 606374269cf3485972c90b993fbb84dc20da032f Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Wed, 28 Feb 2018 14:16:30 -0800 Subject: [PATCH 1/2] FIO_addFInfo: Fully initialize output 'total' struct Silence a Coverity warning about 'windowSize' being uninitialized. (Yes, nothing that calls this routine actually uses the windowSize value. Still, appeasing Coverity is pretty harmless in this case.) --- programs/fileio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/fileio.c b/programs/fileio.c index d344b8f69..94dcb916d 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1963,6 +1963,7 @@ static void displayInfo(const char* inFileName, const fileInfo_t* info, int disp static fileInfo_t FIO_addFInfo(fileInfo_t fi1, fileInfo_t fi2) { fileInfo_t total; + memset(&total, 0, sizeof(total)); total.numActualFrames = fi1.numActualFrames + fi2.numActualFrames; total.numSkippableFrames = fi1.numSkippableFrames + fi2.numSkippableFrames; total.compressedSize = fi1.compressedSize + fi2.compressedSize; From d02b44cf55105c23048c5cc6290b73c79bb519a2 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sun, 4 Mar 2018 16:05:59 -0800 Subject: [PATCH 2/2] DYNAMIC_BMI2 enabled for clang clang only claims compatibility with gcc 4.2. Consequently, recent patch which reserved DYNAMIC_BMI2 for gcc >= 4.8 also disabled it for clang. fix : __clang__ is now enough to enable DYNAMIC_BMI2 (associated with other existing conditions : x64/x64, !bmi2) --- lib/common/compiler.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 63d32258a..bb8730126 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -74,8 +74,11 @@ * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default. */ #ifndef DYNAMIC_BMI2 - #if defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) \ - && (defined(__x86_64__) || defined(_M_X86)) && !defined(__BMI2__) + #if defined(__clang__) \ + || (defined(__GNUC__) \ + && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) \ + && (defined(__x86_64__) || defined(_M_X86)) \ + && !defined(__BMI2__) # define DYNAMIC_BMI2 1 #else # define DYNAMIC_BMI2 0