mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-25 02:30:12 +01:00
list: fix an issue with android build using clang
Sorry, I don't understand the android build system enough to say *which* version of clang this effects, but either "clang-2812033" or "clang-3016494" (probably the later). But when 'sample' is undefined (ie. unitialized variable), the result is not as well defined as it is with gcc. Instead use a typeof() cast with a defined value (ie. zero). This fixes a crash that was reported on android. Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
f19cd3a528
commit
b214b05ccd
1 changed files with 1 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ static inline void list_delinit(struct list_head *item)
|
|||
#ifndef container_of
|
||||
#define container_of(ptr, sample, member) \
|
||||
(void *)((char *)(ptr) \
|
||||
- ((char *)&(sample)->member - (char *)(sample)))
|
||||
- ((char *)&((typeof(sample))0)->member))
|
||||
#endif
|
||||
|
||||
#define LIST_FOR_EACH_ENTRY(pos, head, member) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue