@@ -12,26 +12,34 @@ forward Tag:[2] static stock Func(); // error 010: invalid function or declarat
12
12
forward static stock Tag: [2 ] Func2 (); // OK
13
13
14
14
forward Func3 ();
15
- public Func3 (); // class specifier "public " is introduced; it will be required in the definition
16
- Func3 (){} // error 025: function heading differs from prototype
15
+ stock Func3 (); // class specifier "stock " is added
16
+ Func3 (){} // OK (the function is implicitly defined as "stock")
17
17
18
- static Func4 (); // class specifier "static" is introduced
19
- forward Func4 (); // OK ( class specifiers are only mandatory in function definitions, not declarations)
20
- static Func4 (){} // OK (class specifier "static" is in place )
18
+ forward Func4 ();
19
+ public Func4 (); // class specifier "public" is added
20
+ Func4 (){} // OK (the function is implicitly defined as "public" )
21
21
22
- stock Func5 (){} // Func5() is "finalized"; subsequent forward declarations
23
- // for this function can't introduce specifiers "static" and "public"
24
- forward stock Func5 (); // OK (no new class specifiers)
25
- forward static stock Func5 (); // error 025: function heading differs from prototype
26
- static stock Func5 (); // error 025: function heading differs from prototype
22
+ forward Func5 ();
23
+ static Func5 (); // class specifier "static" is added
24
+ Func5 (){} // OK (the function is implicitly defined as "static")
25
+
26
+ // Func6() is declared as "static", so any subsequent re-declarations
27
+ // of this function with specifier "public" should be treated as errors
28
+ forward static Func6 ();
29
+ forward public Func6 (); // error 025: function heading differs from prototype
30
+ public Func6 (){} // error 025: function heading differs from prototype
27
31
28
- Func6 (){}
29
- forward stock Func6 (); // OK (specifier "stock" can be introduced after the definition)
32
+ stock Func7 (){} // Func4() is "finalized"; subsequent forward declarations
33
+ // for this function can't introduce specifiers "static" and "public"
34
+ forward stock Func7 (); // OK (no new class specifiers)
35
+ forward static stock Func7 (); // error 025: function heading differs from prototype
36
+ static stock Func7 (); // error 025: function heading differs from prototype
30
37
31
- forward stock Func7 (); // specifier "stock" is introduced, but it's not mandatory to use it
32
- // in the function definition
33
- Func7 (){} // OK
38
+ // Func8() is "finalized", but specifier "stock" can be added even after the definition,
39
+ // as it doesn't affect code generation (it only disables warning 203 for the function)
40
+ Func8 (){}
41
+ forward stock Func8 (); // OK
34
42
35
- #pragma unused Func4 , Func5, Func6, Func7
43
+ #pragma unused Func3 , Func5, Func7, Func8
36
44
37
- main (){}
45
+ main (){}
0 commit comments