Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)

2022-08-06 Thread Zhang Mingli
On Aug 6, 2022, 22:47 +0800, Tom Lane , wrote: > Zhang Mingli writes: > > 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 *' */ > > Boy, that comment is showing its age

Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)

2022-08-06 Thread Tom Lane
Zhang Mingli writes: > 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 *' */ Boy, that comment is showing its age isn't it? If we were to do anything about this, I'd

Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)

2022-08-06 Thread Zhang Mingli
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 , wrote: > Hi, > > About the error: > Result of

Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)

2022-08-06 Thread Ranier Vilela
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 diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 473738040b..56e