[petsc-dev] getting rid of clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated

Jed Brown jed at jedbrown.org
Thu Apr 3 17:28:22 CDT 2014


Barry Smith <barryfsmith at me.com> writes:

>   Jed,
>
>    Could gmakefile be modified with 
>
> PETSC_COMPILE.cxx = $(call quiet,CXX) -c $(CXX_FLAGS) $(CFLAGS) $(CCPPFLAGS) $(CXX_DEPFLAGS) $(CXX_X_FLAG)
>
> and 
>
> CXX_X_FLAG set to -x c++   
>
> by configure when it works to get rid of that damn clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated 
>
> message?

It could, but the problem is that if this option is ever passed (perhaps
accidentally) when you run the compiler on something that is not C++
source, the compiler will SEGV (this bug is now fixed) or do something
nonsensical.  For example

  clang++ -x c++ foo.o -o foo

It should be able to go in CCPPFLAGS, provided it is never used incorrectly.
-------------- 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/20140403/973f00f0/attachment.sig>


More information about the petsc-dev mailing list