]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
CMakeLists.txt: Fix warning on gcc-9
authorVitaly Chikunov <vt@altlinux.org>
Wed, 28 Oct 2020 21:58:56 +0000 (00:58 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Thu, 29 Oct 2020 06:15:51 +0000 (09:15 +0300)
/root/rpmbuild/BUILD/openssl-gost-engine-1.1.1/CMakeFiles/CMakeTmp/src.c:4:14: warning: initialization of 'int *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
    4 |     int *p = buf + 1;
      |              ^~~
/root/rpmbuild/BUILD/openssl-gost-engine-1.1.1/CMakeFiles/CMakeTmp/src.c:5:14: warning: initialization of 'int *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
    5 |     int *q = buf + 2;
      |              ^~~

Reported-by: Ilya Shipitsin <https://github.com/chipitsine>
Fixes: #288
CMakeLists.txt

index b7b7938b4b58782855826b004464460ec98ea475..d6e560698c0436902a774f0c091b8c9295529909 100644 (file)
@@ -69,8 +69,8 @@ endif()
 check_c_source_runs("
   int main(void) {
     char buf[16] = { 0, 1, 2 };
-    int *p = buf + 1;
-    int *q = buf + 2;
+    int *p = (int *)(buf + 1);
+    int *q = (int *)(buf + 2);
     return (*p == *q);
   }
   " RELAXED_ALIGNMENT)