title: Warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated
body: <p>What does this clang++ error message mean, and why am I getting it? I can't seem to find <em>anything</em> on the internet about it...<br>
  <code>clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated</code></p>
  
  <p>Here's my code,</p>
  
  <p><strong>MergeSort.h</strong>:</p>
  
  <pre><code>#ifndef __MERGESORT_H__
  #define __MERGESORT_H__
  
  #include &lt;iostream&gt;
  using namespace std;
  
  class MergeSort;
  
  class MergeSort
  {
      public:
  
      MergeSort();
      MergeSort(const int* list, int length);
      ~MergeSort();
  
      friend ostream&amp; operator&lt;&lt; (ostream&amp; os, const MergeSort&amp; ms);
  
      private:
  
      int* list;
      int len;
  };
  
  ostream&amp; operator&lt;&lt; (ostream&amp; os, const MergeSort&amp; ms);
  #endif
  </code></pre>
  
  <p><strong>MergeSort.cpp</strong>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "MergeSort.h"
  
  using namespace std;
  
  MergeSort::MergeSort()
  {
      list = new int[1];
      list[0] = 0;
      len = 0;
  }
  
  MergeSort::MergeSort (const int* t, int length)
  {
      if (t) {
          len = length;
          list = new int[len];
          for (int i = 0; i &lt; length; i++)
              list[i] = t[i];
      }
      else {
          list = new int[1];
          list[0] = 0;
          len = 0;
      }
  }
  
  MergeSort::~MergeSort()
  {
      delete[] list;
  }
  
  ostream&amp; operator&lt;&lt;(ostream&amp; os, const MergeSort&amp; ms)
  {
      for (int i = 0; i &lt; ms.len; i++)
          os &lt;&lt; ms.list[i];
      return os;
  }
  
  
  int
  main()
  {
      int list[] = {1,2,3,4};
      int list_len = sizeof(list)/sizeof(int);
      MergeSort ms = MergeSort(list, list_len);
      cout &lt;&lt; ms &lt;&lt; endl;
      cout &lt;&lt; "hello world" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>And the output:</p>
  
  <pre><code>[gyeh@gyeh mergesort]$ clang++ -c -g -Wall MergeSort.cpp MergeSort.h
  clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated
  [gyeh@gyeh mergesort]$ clang++ MergeSort.o -o MergeSort
  [gyeh@gyeh mergesort]$ valgrind --leak-check=yes ./MergeSort
  ==25774== Memcheck, a memory error detector
  ==25774== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
  ==25774== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
  ==25774== Command: ./MergeSort
  ==25774== 
  1234
  hello world
  ==25774== 
  ==25774== HEAP SUMMARY:
  ==25774==     in use at exit: 0 bytes in 0 blocks
  ==25774==   total heap usage: 1 allocs, 1 frees, 16 bytes allocated
  ==25774== 
  ==25774== All heap blocks were freed -- no leaks are possible
  ==25774== 
  ==25774== For counts of detected and suppressed errors, rerun with: -v
  ==25774== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
  </code></pre>