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

Jed Brown jed at jedbrown.org
Sun Jan 19 19:13:06 CST 2014


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?

$ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140119/82d86e12/attachment.sig>


More information about the petsc-dev mailing list