What is the reason for PetscTruth in the first place? Couldn't one just use bool -- from stdbool.h if available, and otherwise have petsc define it? I guess you might argue that petsc shouldn't invade non petsc-prefixed namespace, which I guess is a valid argument, on the hand one might consider that to just be petsc providing pretty much a standard type which is missing from the current environment. Or are there any Fortran-glue issues that prevent this?<br>
<br>There is PETSC_FLOAT and PETSC_DOUBLE, after all, but not PetscFloat,...<br><br>In general, I don't like having specific versions of what's basically a standard type (I don't like PETSC_NULL, either). If you're using just one library, maybe it's not that bad, but then there's herr_t, PetscErrorCode, ... for no (obvious to me) benefit.<br>
<br>Anyway, I'd be in favor of at least a change to PetscBool.<br><br>--Kai<br><br><br><div class="gmail_quote">On Thu, Sep 2, 2010 at 3:56 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
  We use truth consistently PetscTruth and PETSC_TRUTH, we cannot have one be bool.<br>
<br>
   For a long time I've wanted to replace all our uses of truth with bool but was afraid to make a change that pisses people off. That would resolve the problem.<br>
<font color="#888888"><br>
   Barry<br>
</font><div><div></div><div class="h5"><br>
On Sep 2, 2010, at 2:04 PM, Satish Balay wrote:<br>
<br>
> On Thu, 2 Sep 2010, Chetan Jhurani wrote:<br>
><br>
>> Hi petsc-dev,<br>
>><br>
>> This is a minor enhancement request.<br>
>><br>
>> Using PETSC_TRUTH instead of PETSC_TRUE unintentionally will lead to<br>
>> unexpected results and annoying bugs.  Seems like PETSC_TRUTH is<br>
>> a different enum value for enumerating data types and currently equals 9.<br>
>><br>
>> g++ does warn on comparing different enum types, but gcc does not (v4.3.0).<br>
>><br>
>> Any possibility of changing the name of PETSC_TRUTH to something<br>
>> that is far away from PETSC_TRUE?<br>
><br>
><br>
> Perhaps we should use PETSC_BOOL instead of PETSC_TRUTH..<br>
><br>
> Satish<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kai Germaschewski<br>Assistant Professor, Dept of Physics / Space Science Center<br>University of New Hampshire, Durham, NH 03824<br>office: Morse Hall 245E<br>
phone:  +1-603-862-2912<br>fax: +1-603-862-2771<br><br>