On Mon, 11 Jun 2012 16:39:55 +0200 Roland Mainz wrote:
> Attached (as "astopen20120606_janitor_statementnotreached001.diff") is
> a small cleanup patch which eliminates some of the "statement not
> reached" warnings reported by Sun Studio 12.1. AFAIK these changes are
> simple&&safe enougth for ksh93u+ ...

> There are a few remaining warnings which require some more thinking:
> 1. src/cmd/dsslib/bgp/bgp-mrt.c", line 1721: warning: statement not
> reached (E_STATEMENT_NOT_REACHED)
> This warning is about this function:
> -- snip --
> static int
> mrtwrite(Dssfile_t* file, Dssrecord_t* record, Dssdisc_t* disc)
> {
>       ANONYMIZE_WRITE(file, record, disc);
>       if (disc->errorf)
>               (*disc->errorf)(NiL, disc, 2, "%s: record write not 
> implemented",
> file->format->name);
>       return -1;
> }
> -- snip --
> ... it sounds like that any code beginning with |if (disk->errorf)| is
> not executed.. which doesn't sound like this is intended.

its macro trickery
bgp-mrt.c is compiled 2 different ways, normal and ANONYMIZE
for the ANONYMIZE way ANONYMIZE_WRITE() simply does 'return 0'
fixed by adding an #if ANONYMIZE guard

> 2. src/cmd/kshlib/dss/dss.c", line 189: warning: statement not reached
> (E_STATEMENT_NOT_REACHED)
> This is about the following code... I guess there is a |if
> (...)|-statement missing:
> -- snip --
>       data->data =3D bp->vnode->nvalue;
>       data->size =3D nv_size(bp->vnode);
>               return(1);
>       if(qp->sel)
> -- snip --

the dangling return(1); was the result of a faulty edit of the preceding if() 
statement

thanks

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to