From 31780f7d406519936efb7d00a51fea3af509aa9b Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Fri, 21 Oct 2016 17:16:53 +0200 Subject: [PATCH] nir: fix LTO builds Flexible array members are not supported in C++. The standard solution is to use arrays of size 1, and overallocate containing struct. While technically this is still undefined behavior, it seems to work just fine. --- src/compiler/nir/nir.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index d6c8efa..7bea9fb 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -761,7 +761,7 @@ typedef struct nir_alu_instr { bool exact; nir_alu_dest dest; - nir_alu_src src[]; + nir_alu_src src[1]; } nir_alu_instr; void nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src, @@ -929,7 +929,7 @@ typedef struct { nir_deref_var *variables[2]; - nir_src src[]; + nir_src src[1]; } nir_intrinsic_instr; /** -- 2.9.3