History

__typeof(t) should not include storage modifiers of t

Joe Soroka committed 15 years ago

Commit 38cbb401 parent 5d556472 files · +7 −0Browse files

Unified · Split

2 files
  1. tccgen.c +2 −0
  2. tests/tcctest.c +5 −0
tccgen.c+2−0
@@ -2948,6 +2948,8 @@ static int parse_btype(CType *type, AttributeDef *ad) · 2947 unmodified lines
2948 case TOK_TYPEOF3:2948 case TOK_TYPEOF3:
2949 next();2949 next();
2950 parse_expr_type(&type1);2950 parse_expr_type(&type1);
2951 /* remove all storage modifiers except typedef */
2952 type1.t &= ~(VT_STORAGE&~VT_TYPEDEF);
2951 goto basic_type2;2953 goto basic_type2;
2952 default:2954 default:
2953 if (typespec_found || typedef_found)2955 if (typespec_found || typedef_found)
tests/tcctest.c+5−0
@@ -2365,6 +2365,11 @@ extern int weak_asm_v1 asm("weak_asm_v1x") __attribute · 2364 unmodified lines
2365extern int __attribute((weak)) weak_asm_v2 asm("weak_asm_v2x") ;2365extern int __attribute((weak)) weak_asm_v2 asm("weak_asm_v2x") ;
2366extern int __attribute((weak)) weak_asm_v3(void) asm("weak_asm_v3x") __attribute((weak));2366extern int __attribute((weak)) weak_asm_v3(void) asm("weak_asm_v3x") __attribute((weak));
2367 2367
2368static const size_t dummy = 0;
2369extern __typeof(dummy) weak_dummy1 __attribute__((weak, alias("dummy")));
2370extern __typeof(dummy) __attribute__((weak, alias("dummy"))) weak_dummy2;
2371extern __attribute__((weak, alias("dummy"))) __typeof(dummy) weak_dummy3;
2372
2368void __attribute__((weak)) weak_test(void)2373void __attribute__((weak)) weak_test(void)
2369{2374{
2370 printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123);2375 printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123);

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