-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Roland Illig
Sent: 31 July 2003 12:06
To: [EMAIL PROTECTED]
Subject: [subs] Re: [splint-discuss] Newbie question


On Tue, Jul 29, 2003 at 12:16:52AM +0100, Kenny Stuart wrote:
> Hi all,
>
> Well I'm new to Splint and to this list, I've read the user guide and had
a
> quick browse through the archive but can't work out what I'm doing wrong,
> please help.
>
> %% Given the following example code:
>
> #include <stddef.h>
>
> /[EMAIL PROTECTED]@*/
>
> struct Tomato { int a, b, c; };
> typedef /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ struct Tomato* TOMATO;
>
> static TOMATO Tomato_create( void )
> {
>   TOMATO tomato= (TOMATO)malloc( sizeof *tomato );
>   if( tomato != NULL ) {
>     tomato->a= tomato->b= tomato->c= 0;
>   }
    tomato->a = 0;
    tomato->b = 0;
    tomato->c = 0;
>
>   return tomato;
> }

That might stop splint complaining but the potential NULL dereference would
certainly be an unwelcome side-effect.

Kenny

_______________________________________________
splint-discuss mailing list
[EMAIL PROTECTED]
http://www.splint.org/mailman/listinfo/splint-discuss

Reply via email to