[petsc-dev] Compiling C code with C compiler

Dmitry Karpeev karpeev at mcs.anl.gov
Mon Apr 4 20:58:46 CDT 2011


The only dangerous thing about mixing C and C++ I can think of is PETSc's
reliance
on the specific struct layout when downcasting (e.g., to PetscObject).  What
does the
C++ standard say about this?

Dmitry.

On Mon, Apr 4, 2011 at 8:48 PM, Satish Balay <balay at mcs.anl.gov> wrote:

> There is clang and clang++ - but still they insist on throwing this
> warning.
>
> When I invoke clang++ - I want c++. So I'm not sure whats so ambiguous
> that they should throw this warning.
>
> And what does this depricate mean? That  'clang++ foo.c' will create C
> code?
>
> Then why have both clang and clang++?
>
> satish
>
> On Mon, 4 Apr 2011, Barry Smith wrote:
>
> >
> >    configure.log ????
> >
> >    What about passing the compiler option -x C++? Or maybe you are
> already doing that but I would't know because you didn't send configure.log
> >
> >     It's bad enough when our ignorant users don't send necessary
> configure.log files but you?
> >
> >    Barry
> >
> > On Apr 4, 2011, at 8:33 PM, Sean Farley wrote:
> >
> > > When specifying --with-clanguage=C++ (as required by sieve) all C code
> (any .c file) is still compiled with the C++ compiler. This behavior is
> deprecated as clang will warn you:
> > >
> > > clang: warning: treating 'c' input as 'c++' when in C++ mode, this
> behavior is deprecated
> > >
> > > C is not a subset of C++ and treats structs very differently than C++.
> This should really be handled correctly but I can't read the conf/rules file
> no more than I can read Greek.
> > >
> > > Sean
> > > <make.log>
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110404/85d8f412/attachment.html>


More information about the petsc-dev mailing list