Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8aaca07

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 8a61708 commit 8aaca07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/include/nodes/pg_list.h

+1-1
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)