[petsc-dev] Matt, please don't put buggy code into PETSc

Matthew Knepley knepley at gmail.com
Sun Jan 19 19:15:10 CST 2014


On Sun, Jan 19, 2014 at 7:13 PM, Jed Brown <jed at jedbrown.org> wrote:

> Matthew Knepley <knepley at gmail.com> writes:
> >> What compiler?  Both gcc and clang warn.
> >>
> >
> > I can't believe you are interested:
> >
> > i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
> > Copyright (C) 2007 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is
> NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> This compiler warns for me:
>
> petsc-mini:c jedbrown$ gcc --version
> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
> 5658) (LLVM build 2336.11.00)
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
>
> We have to get to the bottom of this.  What do you get when you compile
> this?
>

What are you talking about? Of fucking course it warns when you use
complex. I never said it did not.
I said that C does not warn when I pass a PetscScalar for a PetscReal when
they are both typedef'd
to double, which it never ever does. Jesus.

   Matt


> $ cat complex.c
> #include <complex.h>
>
> int foo(double *);
> int bar(complex double x) { return foo(&x); }
>
> I get this with the 7-year old compiler Apple is shipping.
>
> petsc-mini:c jedbrown$ gcc -c complex.c
> complex.c: In function 'bar':
> complex.c:4: warning: passing argument 1 of 'foo' from incompatible
> pointer type
>



-- 
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/20140119/eb23808f/attachment.html>


More information about the petsc-dev mailing list