Commit 38fabbf9 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

vtkParseExtras, vtkParsePreprocess: use static storage for returns

GCC 10 warns that pointers to the stack are being returned. Use static
storage for this instead. This code is not thread-safe or re-entrant
anyways, so this is fine.
parent 1762d09c
Pipeline #175012 running with stage
......@@ -133,7 +133,7 @@ static const char* vtkparse_string_replace(
StringCache* cache, const char* str1, int n, const char* name[], const char* val[])
{
const char* cp = str1;
char result_store[1024];
static char result_store[1024];
size_t resultMaxLen = 1024;
char *result, *tmp;
int k;
......
......@@ -4035,7 +4035,7 @@ const char* vtkParsePreprocess_ExpandMacro(
const char* pp = NULL;
const char* dp = NULL;
const char* wp = NULL;
char stack_rp[128];
static char stack_rp[128];
char* rp = NULL;
size_t rs = 0;
size_t i = 0;
......@@ -4420,7 +4420,7 @@ const char* vtkParsePreprocess_ExpandMacro(
*/
const char* vtkParsePreprocess_ProcessString(PreprocessInfo* info, const char* text)
{
char stack_rp[128];
static char stack_rp[128];
char* rp;
char* ep;
size_t i = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment