From eeac529d5ebc197eb25e51c70ce068148e9edd35 Mon Sep 17 00:00:00 2001 From: skye Date: Fri, 10 Apr 2026 16:32:30 -0400 Subject: [PATCH] libexpr/primops: Suppress deprecation warning in prim_importNative as of cl/5456 prim_importNative default constructs a `Value` in order to pass as an out parameter to a ValueInitializer function. Default construction is deprecated, but there isn't a meaningful value to initialize it to instead. After cl/5357 this will give a deprecation warning (which in an asanBuild will be an error), so this commit suppresses that warning for that `Value` construction. Change-Id: Ie567a6e81b5753672001320e9fc816c56a6a6964 --- lix/libexpr/primops.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lix/libexpr/primops.cc b/lix/libexpr/primops.cc index 1237ad7ae..588cce7b5 100644 --- a/lix/libexpr/primops.cc +++ b/lix/libexpr/primops.cc @@ -300,8 +300,16 @@ Value prim_importNative(EvalState & state, Value ** args) state.ctx.errors.make("symbol '%1%' from '%2%' resolved to NULL when a function pointer was expected", sym, path).debugThrow(); } + // Default construction of `Value` is deprecated, and uses of `Value&` out parameters + // have mostly been removed in favor of returning a `Value` instead. However in this + // particular case, this signature (ValueInitializer defined above) is externally visible, + // changing it would be an API breaking change, so for this one instance we just suppress + // the warning instead. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" Value v; (func)(state, v); +#pragma clang diagnostic pop /* We don't dlclose because v may be a primop referencing a function in the shared object file */ return v;