static char *statictest(){<br>&nbsp; static char buff[10];<br>&nbsp; return buff;<br>}<br>int main(){<br>&nbsp; /*@unused@*/<br>&nbsp; char *p=statictest();<br>&nbsp; return 0;<br>}<br>When the above program is fed to&nbsp; splint, the following output results:
<br>statictest.c: (in function statictest)<br>statictest.c:3:10: Unqualified static storage buff returned as implicitly only:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buff<br>&nbsp; Static storage is transferred in an inconsistent way. (Use -statictrans to
<br>&nbsp; inhibit warning)<br>statictest.c: (in function main)<br>statictest.c:8:12: Fresh storage p not released before return<br>&nbsp; A memory leak has been detected. Storage allocated locally is not released<br>&nbsp; before the last reference to it is lost. (Use -mustfreefresh to inhibit
<br>&nbsp; warning)<br>&nbsp;&nbsp; statictest.c:7:24: Fresh storage p created<br><br>Finished checking --- 2 code warnings<br><br>How can I correctly annotate the code to avoid this? I couldn&#39;t find in the manual. <br><br>Thank you in advance.
<br><br>-- <br>Software is like sex: it is better when it is free.