History

Ignore some more attributes

Detected when using -Wunsupported

herman ten brugge committed 1 year ago

Commit ab2ce3b1 parent cdebce32 files · +25 −1Browse files

Unified · Split

2 files
  1. tccgen.c +18 −1
  2. tcctok.h +7 −0
tccgen.c+18−1
@@ -4013,11 +4013,27 @@ redo: · 4012 unmodified lines
40134013 case TOK_NODEBUG2:
40144014 ad->a.nodebug = 1;
40154015 break;
4016+ case TOK_USED1:
4017+ case TOK_USED2:
40164018 case TOK_UNUSED1:
40174019 case TOK_UNUSED2:
40184020 /* currently, no need to handle it because tcc does not
4019− track unused objects */
4021+ track used/unused objects */
40204022 break;
4023+ case TOK_CONST1:
4024+ case TOK_CONST2:
4025+ case TOK_CONST3:
4026+ case TOK_PURE1:
4027+ case TOK_PURE2:
4028+ /* ignored */
4029+ break;
4030+ case TOK_NOINLINE:
4031+ /* ignored */
4032+ break;
4033+ case TOK_FORMAT1:
4034+ case TOK_FORMAT2:
4035+ /* ignored */
4036+ goto skip_param;
40214037 case TOK_NORETURN1:
40224038 case TOK_NORETURN2:
40234039 ad->f.func_noreturn = 1;
@@ -4091,6 +4107,7 @@ redo: · 67 unmodified lines
40914107 default:
40924108 tcc_warning_c(warn_unsupported)("'%s' attribute ignored", get_tok_str(t, NULL));
40934109 /* skip parameters */
4110+skip_param:
40944111 if (tok == '(') {
40954112 int parenthesis = 0;
40964113 do {
tcctok.h+7−0
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323 DEF(TOK_CONST1, "const")
2424 DEF(TOK_CONST2, "__const") /* gcc keyword */
2525 DEF(TOK_CONST3, "__const__") /* gcc keyword */
26+ DEF(TOK_PURE1, "pure")
27+ DEF(TOK_PURE2, "__pure__")
2628 DEF(TOK_VOLATILE1, "volatile")
2729 DEF(TOK_VOLATILE2, "__volatile") /* gcc keyword */
2830 DEF(TOK_VOLATILE3, "__volatile__") /* gcc keyword */
@@ -114,8 +116,12 @@ · 85 unmodified lines
114116 DEF(TOK_WEAK2, "__weak__")
115117 DEF(TOK_ALIAS1, "alias")
116118 DEF(TOK_ALIAS2, "__alias__")
119+ DEF(TOK_USED1, "used")
120+ DEF(TOK_USED2, "__used__")
117121 DEF(TOK_UNUSED1, "unused")
118122 DEF(TOK_UNUSED2, "__unused__")
123+ DEF(TOK_FORMAT1, "format")
124+ DEF(TOK_FORMAT2, "__format__")
119125 DEF(TOK_NODEBUG1, "nodebug")
120126 DEF(TOK_NODEBUG2, "__nodebug__")
121127 DEF(TOK_CDECL1, "cdecl")
@@ -140,6 +146,7 @@ · 18 unmodified lines
140146 DEF(TOK_DESTRUCTOR2, "__destructor__")
141147 DEF(TOK_ALWAYS_INLINE1, "always_inline")
142148 DEF(TOK_ALWAYS_INLINE2, "__always_inline__")
149+ DEF(TOK_NOINLINE, "__noinline__")
143150
144151 DEF(TOK_MODE, "__mode__")
145152 DEF(TOK_MODE_QI, "__QI__")

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