11.05.2012, 04:26
Quote:
With all due respect, go make a public function and try to return a string, and try another public function that doesn't return a value.
I think you'll understand what I mean. |
Quote:
You make it sound it sound as if a method tagged stock will hide all warnings associated with it. This is a side-effect of what an unused stock method does i.e. nothing because it's not compiled into the P-code. The Pawn compiler will still complain about warnings associated with a stock method if it is referenced in your code.
A stock method is a method that is allowed to be skipped by the parser if it's not used. In other words, you will not be warned that it is unused and it does not exist in the compiled code. A method that is not tagged stock and is also unused is still compiled into the P-code, thus using space in the compiled code. You might ask now why doesn't the Pawn compiler just remove unused tagged stock or not to save space? One reason being because it cannot infer whether or not the method is compiled into the script for external purposes (i.e. a public method). You may have public "unused" methods that are callable by an external program. Код:
// start of script main() { foo1(); // foo2() unused, warning } foo1() { /* */ } foo2() { /* */ } // end script |