<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 8, 2015 at 9:08 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">PETSc checkBuilds <<a href="mailto:petsc-checkbuilds@mcs.anl.gov">petsc-checkbuilds@mcs.anl.gov</a>> writes:<br>
> warnings attributed to commit ac76247 Point-to-point PetscSF: bcast and reduce, still need fetch-and-op, ref #9<br>
><br>
> src/vec/is/sf/impls/basic/sfbasic.c:816<br>
> [<a href="http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2015/04/08/build_next_arch-opensolaris-cmplx-pkgs-dbg_n-gage.log" target="_blank">http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2015/04/08/build_next_arch-opensolaris-cmplx-pkgs-dbg_n-gage.log</a>]<br>
> "/export/home/petsc/petsc.clone-3/src/vec/is/sf/impls/basic/sfbasic.c", line 816: warning: loop not entered at top<br>
<br>
How do we fix this? If I remove the final (unreached)<br>
PetscFunctionReturn(0) then the code is invalid when not<br>
PETSC_USE_ERRORCHECKING (no return statement in function returning<br>
non-void). But as long as error checking is on, we don't reach that<br>
statement. Can we tune the warning flags to avoid this noise?<br>
<br>
static PetscErrorCode PetscSFBasicGetPackInUse(PetscSF sf,MPI_Datatype unit,const void *key,PetscCopyMode cmode,PetscSFBasicPack *mylink)<br>
{<br>
PetscSF_Basic *bas = (PetscSF_Basic*)sf->data;<br>
PetscErrorCode ierr;<br>
PetscSFBasicPack link,*p;<br>
<br>
PetscFunctionBegin;<br>
/* Look for types in cache */<br>
for (p=&bas->inuse; (link=*p); p=&link->next) {<br>
PetscBool match;<br>
ierr = MPIPetsc_Type_compare(unit,link->unit,&match);CHKERRQ(ierr);<br>
if (match && (key == link->key)) {<br>
switch (cmode) {<br>
case PETSC_OWN_POINTER: *p = link->next; break; /* Remove from inuse list */<br>
case PETSC_USE_POINTER: break;<br>
default: SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_INCOMP,"invalid cmode");<br>
}<br>
*mylink = link;<br>
PetscFunctionReturn(0);<br>
}<br>
}<br>
SETERRQ(PetscObjectComm((PetscObject)sf),PETSC_ERR_ARG_WRONGSTATE,"Could not find pack");<br>
PetscFunctionReturn(0);<br>
}<br>
</blockquote></div><br>I think you need an if () to make the compiler quit whining.</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Matt<br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>