Bug in documentation for SETERRQ
Barry Smith
bsmith at mcs.anl.gov
Sat Aug 11 18:01:33 CDT 2007
You can use SETERRA(); this is not a great solution
but since it needs to call MPI_Abort(). You could also
check error codes directly and trigger the appropriate
C++ exception.
Barry
On Fri, 10 Aug 2007, Matthew Knepley wrote:
> On 8/10/07, John R. Wicks <jwicks at cs.brown.edu> wrote:
> > SETERRQ is documented to not return a value:
> > Synopsis:
> > void SETERRQ(PetscErrorCode errorcode,char *message)
>
> I have corrected this documentation.
>
> > 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:
>
> This does not make sense, unfortunately. SETERRQ is a C exception
> and thus returns as a matter of definition.
>
> Thanks,
>
> Matt
>
> > #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