Re: Remove useless casts to (void *) - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Remove useless casts to (void *)
Date
Msg-id CAJ7c6TNKK1_Kq4t0_XgNPraRKKcuMtH4eZPfq9YcVP09OXJC5A@mail.gmail.com
Whole thread Raw
In response to Remove useless casts to (void *)  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Remove useless casts to (void *)
Re: Remove useless casts to (void *)
List pgsql-hackers
Hi Bertrand,

> The attached also remove casts that have been added since 7f798aca1d5, the ones
> in pg_publication.c, lock.c and tuplesortvariants.c.
>
> The patch has been generated with the help of the .cocci script [2] (though I
> manually reviewed and removed some matches that, I think, were not appropriate).

I didn't review the entire patch but one change caught my attention:

```
-               databuf = (void *) ((char *) databuf + avail);
+               databuf = (char *) databuf + avail;
```

Here `databuf` has a type (void*). Although the code is correct, it
replaces an explicit cast (which I read "yes, we know what we are
doing") with an implicit one. Personally I don't think this is a good
change.

These were just my two cents. All in all I'm neither for nor against the patch.

-- 
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: 10% drop in code line count in PG 17
Next
From: Mircea Cadariu
Date:
Subject: Re: Metadata and record block access stats for indexes