From c26251cf0a49537c7382104ddf4141f98dbf9efe Mon Sep 17 00:00:00 2001 From: fundamental Date: Sat, 4 Jan 2020 12:51:02 -0500 Subject: [PATCH] Eliminate VLAs for MSVC --- test/common.h | 3 ++- test/pretty-format.cpp | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/common.h b/test/common.h index b477cc2..5b98256 100644 --- a/test/common.h +++ b/test/common.h @@ -198,7 +198,7 @@ int assert_hex_eq(const char *a, const char *b, size_t size_a, size_t size_b, //create difference mask const int longer = size_a > size_b ? size_a : size_b; const int shorter = size_a < size_b ? size_a : size_b; - char mask[longer]; + char *mask = (char*)malloc(longer); memset(mask, 0, longer); for(int i=0; i