瀏覽代碼

TestDriver: Fix -Wconversion warning

Since commit v3.8.0-rc1~51^2~1 (TestDriver: calc NumTests at compile
time, 2017-01-24) we convert an expression that uses `sizeof()` to an
`int` as a compile-time constant.  Some GCC versions warn about this
with `-Wconversion`.  Add a cast to avoid the warning.
Brad King 8 年之前
父節點
當前提交
221ffabfad
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Templates/TestDriver.cxx.in

+ 2 - 2
Templates/TestDriver.cxx.in

@@ -32,8 +32,8 @@ static functionMapEntry cmakeGeneratedFunctionMapEntries[] = {
   { NULL, NULL } /* NOLINT */
   { NULL, NULL } /* NOLINT */
 };
 };
 
 
-static const int NumTests =
-  (sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
+static const int NumTests = CM_CAST(int,
+  sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
 
 
 /* Allocate and create a lowercased copy of string
 /* Allocate and create a lowercased copy of string
    (note that it has to be free'd manually) */
    (note that it has to be free'd manually) */