From 0a7022820e85299364e29113e16d35f4350361f6 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Wed, 19 Aug 2020 23:02:48 +0100 Subject: [PATCH] configure: pass non-null pointer to (v)asprintf Windows clang warns about redefinition of (v)asprintf when targeting Windows 7 because the configure test failed due to passing NULL when to those functions when they tag key parameters with the nonnull attribute. Signed-off-by: Sitsofe Wheeler --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 08571fb0..79a5134d 100755 --- a/configure +++ b/configure @@ -939,7 +939,8 @@ cat > $TMPC << EOF int main(int argc, char **argv) { - return asprintf(NULL, "%s", "str") == 0; + char *buf; + return asprintf(&buf, "%s", "str") == 0; } EOF if compile_prog "" "" "have_asprintf"; then @@ -956,7 +957,8 @@ cat > $TMPC << EOF int main(int argc, char **argv) { va_list ap; - return vasprintf(NULL, "%s", ap) == 0; + char *buf; + return vasprintf(&buf, "%s", ap) == 0; } EOF if compile_prog "" "" "have_vasprintf"; then -- 2.25.1