Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c) - Mailing list pgsql-hackers

From Zhang Mingli
Subject Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)
Date
Msg-id ee8b939e-0821-40f7-b852-bef453e2daee@Spark
Whole thread Raw
In response to Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)
List pgsql-hackers

I think it’s ok, re_guts is converted when  used 

(struct guts *) re->re_guts;

And there is comments in regex.h


char *re_guts; /* `char *' is more portable than `void *' */

Regards,
Zhang Mingli
On Aug 6, 2022, 20:13 +0800, Ranier Vilela <ranier.vf@gmail.com>, wrote:
Hi,

About the error:
Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'struct guts'

The patch attached tries to fix this.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: `make check` doesn't pass on MacOS Catalina
Next
From: Tom Lane
Date:
Subject: Re: `make check` doesn't pass on MacOS Catalina