File tree Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -5546,6 +5546,11 @@ static void statement(int *lastindent,int allow_decl)
5546
5546
matchtoken (tSTATIC );
5547
5547
decl_enum (sLOCAL ,FALSE);
5548
5548
break ;
5549
+ case t__PRAGMA :
5550
+ dopragma ();
5551
+ needtoken (tTERM );
5552
+ pragma_apply (curfunc );
5553
+ break ;
5549
5554
case t__EMIT : {
5550
5555
extern char * sc_tokens [];
5551
5556
const unsigned char * bck_lptr = lptr - strlen (sc_tokens [tok - tFIRST ]);
@@ -8284,7 +8289,7 @@ static void pragma_apply(symbol *sym)
8284
8289
break ;
8285
8290
case attrNAKED :
8286
8291
if (sym -> ident == iFUNCTN )
8287
- sym -> flags = flagNAKED ;
8292
+ sym -> flags |= flagNAKED ;
8288
8293
break ;
8289
8294
default :
8290
8295
assert (0 );
Original file line number Diff line number Diff line change 3
3
' errors ' : " " "
4
4
__pragma.pwn(6) : error 001: expected token: " -identifier-", but found "const"
5
5
__pragma.pwn(10) : error 001: expected token: "-identifier-", but found "__pragma"
6
- __pragma.pwn(31) : warning 234: function is deprecated (symbol "Func") - use OtherFunc() instead
7
- __pragma.pwn(28) : warning 203: symbol is never used: "f"
8
- __pragma.pwn(24) : warning 204: symbol is assigned a value that is never used: "e"
9
- __pragma.pwn(24 -- 37) : warning 203: symbol is never used: "operator~(Tag:)"
6
+ __pragma.pwn(36) : warning 234: function is deprecated (symbol "Func") - use OtherFunc() instead
7
+ __pragma.pwn(40) : warning 234: function is deprecated (symbol "NakedFunc") - use NakedFunc2() instead
8
+ __pragma.pwn(33) : warning 203: symbol is never used: "f"
9
+ __pragma.pwn(29) : warning 204: symbol is assigned a value that is never used: "e"
10
+ __pragma.pwn(29 -- 42) : warning 203: symbol is never used: "operator~(Tag:)"
10
11
" " "
11
12
}
Original file line number Diff line number Diff line change @@ -9,10 +9,15 @@ stock Func3(__pragma("unread") const arg) {}
9
9
// "__pragma" can't be used between the tag and the symbol name
10
10
stock Func4 (Tag: __pragma (" unread" ) arg) {}
11
11
12
- __pragma (" naked" ) NakedFunc(__pragma (" naked" , " unused" ) arg) {}
13
-
14
12
operator~ (Tag: val[],count) {}
15
13
14
+ NakedFunc ()
15
+ {
16
+ __pragma (" naked" , " deprecated - use NakedFunc2() instead" );
17
+ }
18
+
19
+ __pragma (" naked" ) NakedFunc2(__pragma (" naked" , " unused" ) arg = 0 ) {}
20
+
16
21
main ()
17
22
{
18
23
new __pragma (" unwritten" , " unread" ) a = 0 ;
30
35
// warning 234: function is deprecated (symbol "Func") - use OtherFunc() instead
31
36
Func (0 );
32
37
33
- // NakedFunc() is marked as "naked", so there should be no warning about it
34
- // having to return a value
35
- return NakedFunc (0 );
38
+ // NakedFunc() and NakedFunc2() are marked as "naked", so there should be
39
+ // no warnings about them having to return a value.
40
+ return NakedFunc (), NakedFunc2 ( );
36
41
}
You can’t perform that action at this time.
0 commit comments