Hi,<br><br>Thanks for the response, this gives me what I wanted to check.<br>Actually, I wanted to run splint on glibc code, specially the loader code. Do you think it is possible to check such functions with splint, I would like to give this extension.<br>
<br>Also, I want to get the same result from a CPP code, I will try to use the splint code to get this result. Do any one has suggestion for it.<br><br>Regards<br>Vijayendra Suman<br><br><div class="gmail_quote">On Tue, May 12, 2009 at 6:02 PM, Ludolf Holzheid <span dir="ltr"><<a href="mailto:lholzheid@bihl-wiedemann.de">lholzheid@bihl-wiedemann.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Tue, 2009-05-12 16:52:44 +0530, Vijayendra Suman wrote:<br>
> Hello All,<br>
><br>
> Thanks for the prompt response,<br>
><br>
> Here is the small piece of code this is compilable<br>
</div>> [..]<br>
<br>
If you move the nested functions out of Call() like this:<br>
<br>
>> #include <stdio.h><br>
>><br>
>> static int MyOne(void)<br>
>> {<br>
>> printf("One \n");<br>
>> return 1;<br>
>> }<br>
>><br>
>> static int MyTwo(void)<br>
>> {<br>
>> printf("Two \n");<br>
>> return 2;<br>
>> }<br>
>><br>
>> static void Call(int *a)<br>
>> {<br>
>> int StatusUpdate;<br>
<div class="im">>> if (a==NULL) return;<br>
>> if (*a == 1 )<br>
>> StatusUpdate = MyOne();<br>
>> else<br>
>> StatusUpdate = MyTwo();<br>
>> }<br>
>><br>
</div>>> int main(void)<br>
>> {<br>
<div class="im">>> int call; /* call is not initialized */<br>
</div>>> Call(&call);<br>
>> return 0;<br>
>> }<br>
<br>
and run the result through splint, you will get the following:<br>
<br>
>> $ /c/Program\ Files/splint-3.1.1/bin/splint y.c<br>
>> Splint 3.1.1 --- 12 April 2003<br>
>><br>
>> y.c: (in function main)<br>
>> y.c(28,8): Passed storage &call not completely defined: Call (&call)<br>
<div class="im">>> Storage derivable from a parameter, return value or global is not<br>
>> defined.<br>
>> Use /*@out@*/ to denote passed or returned storage which need not be<br>
>> defined.<br>
>> (Use -compdef to inhibit warning)<br>
>><br>
</div>>> Finished checking --- 1 code warning<br>
<br>
That is, splint _does_ complain about using 'call' without prior<br>
initialization.<br>
<br>
Does this answer your question?<br>
<div><div></div><div class="h5"><br>
Ludolf<br>
<br>
--<br>
<br>
---------------------------------------------------------------<br>
Ludolf Holzheid Tel: +49 621 339960<br>
Bihl+Wiedemann GmbH Fax: +49 621 3392239<br>
Floßwörthstraße 41 e-mail: <a href="mailto:lholzheid@bihl-wiedemann.de">lholzheid@bihl-wiedemann.de</a><br>
D-68199 Mannheim, Germany<br>
---------------------------------------------------------------<br>
<br>
_______________________________________________<br>
splint-discuss mailing list<br>
<a href="mailto:splint-discuss@mail.cs.virginia.edu">splint-discuss@mail.cs.virginia.edu</a><br>
<a href="http://www.cs.virginia.edu/mailman/listinfo/splint-discuss" target="_blank">http://www.cs.virginia.edu/mailman/listinfo/splint-discuss</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="https://mail.google.com/mail/?ui=2&view=bsp&ver=1qygpcgurkovy">https://mail.google.com/mail/?ui=2&view=bsp&ver=1qygpcgurkovy</a><br>Regards <br>
Vijayendra Suman<br>