title: What is the purpose of extern C AND C++ for a single function (bsearch / qsort)?
body: <p>When browsing through a draft of the standard (N4527), I found the following paragraph ([alg.c.library]):</p>
  
  <blockquote>
    <p>The function signature:</p>
  
  <pre><code>bsearch(const void *, const void *, size_t, size_t,
      int (*)(const void *, const void *));
  </code></pre>
    
    <p>is replaced by the two declarations:</p>
  
  <pre><code>extern "C" void* bsearch(const void* key, const void* base,
                           size_t nmemb, size_t size,
                           int (*compar)(const void*, const void*));
  extern "C++" void* bsearch(const void* key, const void* base,
                             size_t nmemb, size_t size,
                             int (*compar)(const void*, const void*));
  </code></pre>
  </blockquote>
  
  <p>And the same stuff for <code>qsort</code>.</p>
  
  <p>I also found in [dcl.link]:</p>
  
  <blockquote>
    <p>If two declarations declare functions with the same name and parameter-type-list (8.3.5) to be members of the same namespace or declare objects with the same name to be members of the same namespace and the declarations give the names different language linkages, the program is ill-formed;</p>
  </blockquote>
  
  <p>What is the purpose of these two <code>extern</code> declaration of the same function? Why is this block not ill-formed?</p>