Skip to content

Commit d5ca15e

Browse files
Add type cast to foreach_internal's loop variable.
C++ requires explicitly casting void pointers to the appropriate pointer type, which means the foreach_ptr macro cannot be used in C++ code without this change. Author: Jelte Fennema-Nio Reviewed-by: Bruce Momjian Discussion: https://postgr.es/m/CAGECzQSYG3QfHrc-rOk2KbnB9iJOd7Qu-Xii1s-GTA%3D3JFt49Q%40mail.gmail.com Backpatch-through: 17
1 parent 2453196 commit d5ca15e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/include/nodes/pg_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ for_each_cell_setup(const List *lst, const ListCell *initcell)
485485
for (ForEachState var##__state = {(lst), 0}; \
486486
(var##__state.l != NIL && \
487487
var##__state.i < var##__state.l->length && \
488-
(var = func(&var##__state.l->elements[var##__state.i]), true)); \
488+
(var = (type pointer) func(&var##__state.l->elements[var##__state.i]), true)); \
489489
var##__state.i++)
490490

491491
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy