Keep the same as gcc and clang. The usage exists in MinGW-w64 headers.
Unified · Split
| @@ -7685,9 +7685,13 @@ static int decl0(int l, int is_for_loop_init, Sym *func_sym) · 7684 unmodified lines | ||
| 7685 | 7685 | |
| 7686 | 7686 | #ifdef TCC_TARGET_PE |
| 7687 | 7687 | if (ad.a.dllimport || ad.a.dllexport) { |
| 7688 | − if (type.t & (VT_STATIC|VT_TYPEDEF)) | |
| 7689 | − tcc_error("cannot have dll linkage with static or typedef"); | |
| 7690 | − if (ad.a.dllimport) { | |
| 7688 | + if (type.t & VT_STATIC) | |
| 7689 | + tcc_error("cannot have dll linkage with static"); | |
| 7690 | + if (type.t & VT_TYPEDEF) { | |
| 7691 | + tcc_warning("'%s' attribute ignored for typedef", | |
| 7692 | + ad.a.dllimport ? (ad.a.dllimport = 0, "dllimport") : | |
| 7693 | + (ad.a.dllexport = 0, "dllexport")); | |
| 7694 | + } else if (ad.a.dllimport) { | |
| 7691 | 7695 | if ((type.t & VT_BTYPE) == VT_FUNC) |
| 7692 | 7696 | ad.a.dllimport = 0; |
| 7693 | 7697 | else |