History

allow c11 feature only when -std=c11 is use

matthias gatto committed 7 years ago

Commit 756988e1 parent a3a29172 files · +11 −1Browse files

Unified · Split

2 files
  1. tccgen.c +5 −0
  2. tests/tests2/Makefile +6 −1
tccgen.c+5−0
@@ -4890,6 +4890,9 @@ ST_FUNC void unary(void) · 4889 unmodified lines
48904890 case TOK_ALIGNOF1:
48914891 case TOK_ALIGNOF2:
48924892 case TOK_ALIGNOF3:
4893+ if (tcc_state->cversion != 201112 &&
4894+ tok == TOK_ALIGNOF3)
4895+ goto tok_identifier;
48934896 t = tok;
48944897 next();
48954898 in_sizeof++;
@@ -5099,6 +5102,8 @@ ST_FUNC void unary(void) · 203 unmodified lines
50995102 TokenString *str = NULL;
51005103 int saved_const_wanted = const_wanted;
51015104
5105+ if (tcc_state->cversion != 201112)
5106+ goto tok_identifier;
51025107 next();
51035108 skip('(');
51045109 const_wanted = 0;
tests/tests2/Makefile+6−1
@@ -42,11 +42,16 @@ NORUN = · 41 unmodified lines
4242 42_function_pointer.test : NORUN = true
4343
4444 # Some tests might need different flags
45+33_ternary_op.test : FLAGS += -std=c11
46+
4547 FLAGS =
4648 76_dollars_in_identifiers.test : FLAGS += -fdollars-in-identifiers
4749
4850 # These tests run several snippets from the same file one by one
49−60_errors_and_warnings.test : FLAGS += -dt
51+60_errors_and_warnings.test : FLAGS += -dt -std=c11
52+
53+94_generic.test : FLAGS += -std=c11
54+
5055 96_nodata_wanted.test : FLAGS += -dt
5156
5257 # Always generate certain .expects (don't put these in the GIT),

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