From 9091df56cbb91c668c6ef3e26899d2839d38e8a5 Mon Sep 17 00:00:00 2001 From: davedets Date: Tue, 16 Jun 2026 15:09:18 -0700 Subject: [PATCH] Fix instance of "flexible array member". (#9883) This is another PR towards the goal of getting a clean build with clang, using the compiler options used in building clang-tidy. In https://github.com/Z3Prover/z3/pull/9800, we changed the build flags to eliminate a warning for zero-length arrays. In that PR, I missed this one: there was one instance of m_arr[] instead of m_arr[0]. In the clang-tidy build, that gives warnings like: ``` /Users/daviddetlefs/llvm-project/build_dbg/_deps/z3-src/src/model/func_interp.h:43:12: warning: flexible array members are a C99 feature [-Wc99-extensions] ``` The PR fixes this, making it a zero-length array, the idiom used in all the other similar cases. I also added the compiler flag that produced this warning, so we can notice such changes in the future. --- src/model/func_interp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/func_interp.h b/src/model/func_interp.h index e531e01cf..e3935e05e 100644 --- a/src/model/func_interp.h +++ b/src/model/func_interp.h @@ -40,7 +40,7 @@ class func_entry { // m_result and m_args[i] must be ground terms. expr * m_result; - expr * m_args[]; + expr * m_args[0]; static unsigned get_obj_size(unsigned arity) { return sizeof(func_entry) + arity * sizeof(expr*); } func_entry(ast_manager & m, unsigned arity, expr * const * args, expr * result);