Matthew Knepley <[email protected]> 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
pgpm__BODS2Dw.pgp
Description: PGP signature
