Bug in documentation for SETERRQ

John R. Wicks jwicks at cs.brown.edu
Fri Aug 10 05:40:46 CDT 2007


SETERRQ is documented to not return a value:
Synopsis:
void SETERRQ(PetscErrorCode errorcode,char *message) 

but it is defined in petscerror.h in terms of a return statement:

#define SETERRQ(n,s)              {return
PetscError(__LINE__,__FUNCT__,__FILE__,__SDIR__,n,1,s);}

which causes a compilation error when it is called in a C++
constructor/destructor, for example. 

A truly void error check, such as:

#define ckPetscErr(n, s) {if(0!=n)
PetscError(__LINE__,__FUNCT__,__FILE__,__SDIR__,n,1,s);} 

or:

#define ckPetscErr(stmnt, s) {PetscErrorCode ierr=stmnt;if(0!=ierr)
PetscError(__LINE__,__FUNCT__,__FILE__,__SDIR__,ierr,1,s);}

would be helpful.




More information about the petsc-users mailing list