On Mon, Mar 19, 2012 at 10:23 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Mon, Mar 19, 2012 at 09:59, Matthew Knepley <knepley at gmail.com> wrote:
>
>> ctetgen.c:10050:20: warning: cast to pointer from integer of different
>>> size [-Wint-to-pointer-cast]
>>> ctetgen.c:10070:21: warning: cast to pointer from integer of different
>>> size [-Wint-to-pointer-cast]
>>>
>>
>> I can't change this, since this is what the package does. I guess they
>> get away with it now.
>>
>
> It's a normal int, not a PetscInt, so at least it will always fit in that
> pointer variable.
>
> You can silence the warning by changing the line from
>
>     leftarray[0] = (point) i; // The array length.
>
> to
>
>     leftarray[0] = (point) (PETSC_UINTPTR_T)i; // The array length.
>

Oh, I see now. Fixed.


> Note that every // comment needs to be fixed. There are still a number of
> Wunused-but-set-variable
>

Yes, I was waiting on the comments. That will be a ton of mindless work.

I know about the unused stuff. I was reluctant to remove a bunch of these
statement so that I could
remain statement compatible with TetGen for debugging purposes. I can
comment them out.


> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: In function
> ?TetGenMeshBTreeSort?:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:10050:20: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:10070:21: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: In function
> ?TetGenMeshFindDirection2?:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:13153:49: warning: variable
> ?cop? set but not used [-Wunused-but-set-variable]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: In function
> ?TetGenMeshConstrainedFacets?:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:15042:22: warning: variable
> ?delaunayflag? set but not used [-Wunused-but-set-variable]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: In function
> ?TetGenMeshConstrainedFacets2?:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:15340:22: warning: variable
> ?delaunayflag? set but not used [-Wunused-but-set-variable]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: In function
> ?TetGenMeshRepairEncSubs?:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:18617:8: warning: variable
> ?oldptnum? set but not used [-Wunused-but-set-variable]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: In function
> ?TetGenMeshOptimize?:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:19734:18: warning: variable
> ?maxdihed? set but not used [-Wunused-but-set-variable]
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c: At top level:
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:2026:23: warning:
> ?ListHasItem? defined but not used [-Wunused-function]
>
>
> And the complex/int64 build is broken:
>
> /home/jed/petsc/src/dm/impls/complex/complex.c:4047:36: error: assigning
> to 'PetscReal' (aka 'double') from incompatible type 'PetscScalar' (aka
> 'complex<double>');
>         in->pointlist[idx*dim + d] = array[off+d];
>                                    ^ ~~~~~~~~~~~~
> /home/jed/petsc/src/dm/impls/complex/complex.c:4049:14: error: no matching
> function for call to 'DMComplexGetLabelValue'
>       ierr = DMComplexGetLabelValue(boundary, "marker", v,
> &in->pointmarkerlist[idx]);CHKERRQ(ierr);
>              ^~~~~~~~~~~~~~~~~~~~~~
> /home/jed/petsc/src/dm/impls/complex/complex.c:1821:16: note: candidate
> function not viable: no known conversion from 'int *' to 'PetscInt *' (aka
> 'long long *') for 4th argument;
> PetscErrorCode DMComplexGetLabelValue(DM dm, const char name[], PetscInt
> point, PetscInt *value)
>                ^
> /home/jed/petsc/src/dm/impls/complex/complex.c:4082:14: error: no matching
> function for call to 'DMComplexGetLabelValue'
>       ierr = DMComplexGetLabelValue(boundary, "marker", f,
> &in->facetmarkerlist[idx]);CHKERRQ(ierr);
>              ^~~~~~~~~~~~~~~~~~~~~~
> /home/jed/petsc/src/dm/impls/complex/complex.c:1821:16: note: candidate
> function not viable: no known conversion from 'int *' to 'PetscInt *' (aka
> 'long long *') for 4th argument;
> PetscErrorCode DMComplexGetLabelValue(DM dm, const char name[], PetscInt
> point, PetscInt *value)
>                ^
> /home/jed/petsc/src/dm/impls/complex/complex.c:4300:36: error: assigning
> to 'PetscReal' (aka 'double') from incompatible type 'PetscScalar' (aka
> 'complex<double>');
>         in->pointlist[idx*dim + d] = array[off+d];
>                                    ^ ~~~~~~~~~~~~
> /home/jed/petsc/src/dm/impls/complex/complex.c:4302:14: error: no matching
> function for call to 'DMComplexGetLabelValue'
>       ierr = DMComplexGetLabelValue(dm, "marker", v,
> &in->pointmarkerlist[idx]);CHKERRQ(ierr);
>              ^~~~~~~~~~~~~~~~~~~~~~
> /home/jed/petsc/src/dm/impls/complex/complex.c:1821:16: note: candidate
> function not viable: no known conversion from 'int *' to 'PetscInt *' (aka
> 'long long *') for 4th argument;
> PetscErrorCode DMComplexGetLabelValue(DM dm, const char name[], PetscInt
> point, PetscInt *value)
>                ^
> 5 errors generated.
> make[2]: *** [CMakeFiles/petsc.dir/src/dm/impls/complex/complex.c.o] Error
> 1
> make[2]: *** Waiting for unfinished jobs....
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:14202:26: warning: if
> statement has empty body [-Wempty-body]
>       if (!crossface.tet); {SETERRQ(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Not
> handled yet");}
>                          ^
> /home/jed/petsc/src/dm/impls/complex/ctetgen.c:2026:23: warning: unused
> function 'ListHasItem' [-Wunused-function]
> static PetscErrorCode ListHasItem(List *l, void *checkitem, int *idx)
>

I will fix this somehow.

   Matt

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120319/1f7a515f/attachment.html>

Reply via email to