[PATCH rdma-core 02/19] util: Enable uninitialized_var on powerpc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

For some reason the gcc 8/3 build for powerpc behaves differently from
AMD64 and ARM64:

../providers/mlx4/qp.c: In function 'mlx4_post_send':
../providers/mlx4/qp.c:478:22: warning: 'ctrl' may be used uninitialized in this function [-Wmaybe-uninitialized]
   ctrl->owner_opcode |= htobe32((qp->sq.head & 0xffff) << 8);

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 util/compiler.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/util/compiler.h b/util/compiler.h
index 16f5ee14be2a8a..dfce82f1884149 100644
--- a/util/compiler.h
+++ b/util/compiler.h
@@ -7,9 +7,10 @@
 
    This is only enabled for old compilers. gcc 6.x and beyond have excellent
    static flow analysis. If code solicits a warning from 6.x it is almost
-   certainly too complex for a human to understand.
+   certainly too complex for a human to understand. For some reason powerpc
+   uses a different scheme than gcc for flow analysis.
 */
-#if __GNUC__ >= 6 || defined(__clang__)
+#if (__GNUC__ >= 6 && !defined(__powerpc__)) || defined(__clang__)
 #define uninitialized_var(x) x
 #else
 #define uninitialized_var(x) x = x
-- 
2.22.0




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux