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)
55465546 matchtoken (tSTATIC );
55475547 decl_enum (sLOCAL ,FALSE);
55485548 break ;
5549+ case t__PRAGMA :
5550+ dopragma ();
5551+ needtoken (tTERM );
5552+ pragma_apply (curfunc );
5553+ break ;
55495554 case t__EMIT : {
55505555 extern char * sc_tokens [];
55515556 const unsigned char * bck_lptr = lptr - strlen (sc_tokens [tok - tFIRST ]);
@@ -8284,7 +8289,7 @@ static void pragma_apply(symbol *sym)
82848289 break ;
82858290 case attrNAKED :
82868291 if (sym -> ident == iFUNCTN )
8287- sym -> flags = flagNAKED ;
8292+ sym -> flags |= flagNAKED ;
82888293 break ;
82898294 default :
82908295 assert (0 );
Original file line number Diff line number Diff line change 33 ' errors ' : " " "
44__pragma.pwn(6) : error 001: expected token: " -identifier-", but found "const"
55__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:)"
1011" " "
1112}
Original file line number Diff line number Diff line change @@ -9,10 +9,15 @@ stock Func3(__pragma("unread") const arg) {}
99// "__pragma" can't be used between the tag and the symbol name
1010stock Func4 (Tag: __pragma (" unread" ) arg) {}
1111
12- __pragma (" naked" ) NakedFunc(__pragma (" naked" , " unused" ) arg) {}
13-
1412operator~ (Tag: val[],count) {}
1513
14+ NakedFunc ()
15+ {
16+ __pragma (" naked" , " deprecated - use NakedFunc2() instead" );
17+ }
18+
19+ __pragma (" naked" ) NakedFunc2(__pragma (" naked" , " unused" ) arg = 0 ) {}
20+
1621main ()
1722{
1823 new __pragma (" unwritten" , " unread" ) a = 0 ;
3035 // warning 234: function is deprecated (symbol "Func") - use OtherFunc() instead
3136 Func (0 );
3237
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 ( );
3641}
You can’t perform that action at this time.
0 commit comments