History

tccpp.c: fix a warning showing up with -fstrict-flex-arrays=3

Sigrid Solveig Haflínudóttir committed 10 months ago

Commit f45fbfb1 parent 04ac0cb2 files · +2 −2Browse files

Unified · Split

2 files
  1. tcc.h +1 −1
  2. tccpp.c +1 −1
tcc.h+1−1
@@ -438,7 +438,7 @@ typedef struct TokenSym { · 437 unmodified lines
438 struct Sym *sym_identifier; /* direct pointer to identifier */438 struct Sym *sym_identifier; /* direct pointer to identifier */
439 int tok; /* token number */439 int tok; /* token number */
440 int len;440 int len;
441 char str[1];441 char str[];
442} TokenSym;442} TokenSym;
443 443
444#ifdef TCC_TARGET_PE444#ifdef TCC_TARGET_PE
tccpp.c+1−1
@@ -490,7 +490,7 @@ static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len) · 489 unmodified lines
490 table_ident = ptable;490 table_ident = ptable;
491 }491 }
492 492
493 ts = tal_realloc(&toksym_alloc, 0, sizeof(TokenSym) + len);493 ts = tal_realloc(&toksym_alloc, 0, sizeof(TokenSym) + len + 1);
494 table_ident[i] = ts;494 table_ident[i] = ts;
495 ts->tok = tok_ident++;495 ts->tok = tok_ident++;
496 ts->sym_define = NULL;496 ts->sym_define = NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t