History

tccgen.c: local extern decls: copy s->ref for VT_PTR too

This fixes the issue int main() { extern char *x; } void main1() { extern char *x; } t2.c:5: error: incompatible types for redefinition of 'x' (reported by Giovanni Mascellani 2019/07/16)

grischka committed 7 years ago

Commit 7b8799e1 parent 92985554 files · +42 −14Browse files

Showing the changes to tests (2 of 4 files). Show all

Unified · Split

2 files
  1. tests/tests2/60_errors_and_warnings.c +22 −0
  2. tests/tests2/60_errors_and_warnings.expect +2 −0
tests/tests2/60_errors_and_warnings.c+22−0
@@ -273,5 +273,27 @@ int main () · 272 unmodified lines
273int xxx[1] = {1};273int xxx[1] = {1};
274int bar() { P(3, xxx[0]); return 0; }274int bar() { P(3, xxx[0]); return 0; }
275 275
276#elif defined test_var_4
277struct yyy { int y; };
278struct zzz;
279void f1() {
280 extern char *x;
281 extern char **xx;
282 extern struct yyy y;
283 extern struct yyy *yy;
284 extern struct zzz z;
285 extern struct zzz *zz;
286}
287void f2() {
288 extern char *x;
289 extern char **xx;
290 extern struct yyy y;
291 extern struct yyy *yy;
292 extern struct zzz z;
293 extern struct zzz *zz;
294}
295struct yyy y, *yy;
296struct zzz { int z; } z, *zz;
297
276/******************************************************************/298/******************************************************************/
277#endif299#endif
tests/tests2/60_errors_and_warnings.expect+2−0
@@ -132,3 +132,5 @@ bar : 3 ; 3 · 131 unmodified lines
132 132
133[test_var_3]133[test_var_3]
13460_errors_and_warnings.c:273: error: incompatible types for redefinition of 'xxx'13460_errors_and_warnings.c:273: error: incompatible types for redefinition of 'xxx'
135
136[test_var_4]

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