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

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Subject: Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)
Date: 2022-08-06 14:05:41
Message-ID: ee8b939e-0821-40f7-b852-bef453e2daee@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)vf(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-08-06 14:41:09 Re: `make check` doesn't pass on MacOS Catalina
Previous Message Andrew Dunstan 2022-08-06 13:51:50 Re: `make check` doesn't pass on MacOS Catalina