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

Barry Smith bsmith at mcs.anl.gov
Thu Apr 3 17:32:53 CDT 2014


On Apr 3, 2014, at 5:28 PM, Jed Brown <jed at jedbrown.org> wrote:

> 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.  

   Yes, I read all that. This is why I proposed putting it here ONLY. So  handle it  separately from other flags and hence it CANNOT “ever be passed (perhaps accidentally)” elsewhere.


> For example
> 
>  clang++ -x c++ foo.o -o foo
> 
> It should be able to go in CCPPFLAGS, provided it is never used incorrectly.

   I am fine with it going in CCPPFLAGS also if that works. 

   I am just not happy with the status quo of that damn message.

   Barry





More information about the petsc-dev mailing list