Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44573 )
Change subject: include/list.h: Add support for GCC9+
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/44573/2/src/include/list.h
File src/include/list.h:
https://review.coreboot.org/c/coreboot/+/44573/2/src/include/list.h@23
PS2, Line 23: typeof(*(ptr)), member))
Untested, but we can simply avoid the overflow by adding another
variable:
#define list_for_each(ptr, head, member) \
for (struct list_node *it = (head).next, \
(ptr) = container_of(it, typeof(*(ptr)), member); \
it != NULL; \
it = it->next, \
(ptr) = container_of(it, typeof(*(ptr)), member))
OTOH, `it` would ideally be declared outside the macro which would require
us to adapt all invocations.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/44573
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0d569b59a23d1269f8575fcbbe92a5a6816aa1f7
Gerrit-Change-Number: 44573
Gerrit-PatchSet: 2
Gerrit-Owner: Patrick Rudolph
siro@das-labor.org
Gerrit-Reviewer: Angel Pons
th3fanbus@gmail.com
Gerrit-Reviewer: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: HAOUAS Elyes
ehaouas@noos.fr
Gerrit-Reviewer: Iru Cai (vimacs)
mytbk920423@gmail.com
Gerrit-Reviewer: Martin Roth
martinroth@google.com
Gerrit-Reviewer: Nico Huber
nico.h@gmx.de
Gerrit-Reviewer: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-Comment-Date: Wed, 19 Aug 2020 08:08:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment