[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in documentation for SETERRQ
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: Bug in documentation for SETERRQ
- From: "Matthew Knepley" <knepley@xxxxxxxxx>
- Date: Fri, 10 Aug 2007 17:46:59 -0500
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nV1sI1dAMpdKyUS9iu4S3ZyV82el6BbsiewOkeMSL+vdikR9o2Y319LIECjJSecC93QJm72FGfQIeQhgq+53QrqucteOiVujA/rhj4D1cdfeSDTY2BoTFJxpyR1X9avI/HW4j9mjmxvP6FyK/IYOyrSK3GFviao1cUS2jg08RmA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ohfaIA7D+Qh8M2PbS+JmqREJQnmazNKux72vMZ9OBy9O0eGYA3oKW9v+LCGyiGmZKKT28onbb1vdqGYqEJav9G+rrmCwW3BF6aqlz5+wBTCDR1tFM1LXuQydvZZzTHoakhef3BMwMB5l+f47DJ0ZkiQEb+Xt73d+1tG/XEWAJyk=
- In-reply-to: <000b01c7db3a$e9664bd0$6401a8c0@jwickslptp>
- References: <000001c7da94$354381a0$7900000a@jwickslptp> <000b01c7db3a$e9664bd0$6401a8c0@jwickslptp>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
On 8/10/07, John R. Wicks <jwicks@xxxxxxxxxxxx> 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.
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener