Use flexible array members for structs that end with var-sized arrays
- Since Clang++, G++, and VC++ all support this extension (even though it's technically officially only part of C99), use it. It lets Clang's array- bounds checker know that these are meant to be accessed out of their so-called "bounds".
This commit is contained in:
parent
fbddfbe576
commit
43fe317dbe
4 changed files with 7 additions and 7 deletions
|
|
@ -558,8 +558,8 @@ static visplane_t *new_visplane (unsigned hash)
|
|||
|
||||
if (check == NULL)
|
||||
{
|
||||
check = (visplane_t *)M_Malloc (sizeof(*check) + sizeof(*check->top)*(MAXWIDTH*2));
|
||||
memset(check, 0, sizeof(*check) + sizeof(*check->top)*(MAXWIDTH*2));
|
||||
check = (visplane_t *)M_Malloc (sizeof(*check) + 3 + sizeof(*check->top)*(MAXWIDTH*2));
|
||||
memset(check, 0, sizeof(*check) + 3 + sizeof(*check->top)*(MAXWIDTH*2));
|
||||
check->bottom = check->top + MAXWIDTH+2;
|
||||
}
|
||||
else if (NULL == (freetail = freetail->next))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue