<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE2ToyAQ_TXm0hVLIV8ePGTM7tz2NFVzTKG0yhaBFGCS-ffbaJLNfOxcNkUZoF-3j9cPayvfysoaryQ6CD1Ca7W2Z2U6aKzEhG-TbJdkt-cqu45pybgyjR4kQsIrH6SyaZ_wH1NUmQAHoUzCNgkrkvXTtA3QHh3FWtqnFHQuYRUkjAX0IVlWhGcRz-94h2FwBrL7VrLefc1nfFb2cFQ6niD0yo_HgLMKPRCuaxqYdzQBYSTgRRyUmZAIEuuhA2Va6w4iKGvuWQ6FRN3C_BwzfW_P_oNWj1k0g-vBvlePV3kUi1dsxcfJFrZ17fAEv4ZDjTEd8gVJs9m97l-2z_uTcErUGqM8V20AxvwF5dOccNuXvREHhOsv1qACykjlsAlEjLTvouK2bT2GGM8u63pUfHvj_b745rG4xEbvW6XxWnz1AVx8AlMrbuCcfyQuPsEbq4eDmeCLD-j6ER3eju-PyavswpZ4N-A9rX1Mw0tAZ4S-peXfgSMj4aa-PoC_9N1rj2SUaLib_0b_UAGaduqEYOw_jJI-1nmJrqUh4OgsdfsA5x4NBPc2OtXC4Mms0x0Cep8wX96oNE2pqRE_GXvkMZ_IoZyuBZF43j1FNNVRYaSu6cpGe4twJQc9BU0s01InJUTd5Xh_BDTCh_GkdtASDMawhZr4WYMpzGTJZcELMRND6K0ra6U1HV2o2eB02Ydw9PGSsJ80OlJrqFPiQAutT7e_Ocnwm7xLS-X9gJ4mS86Wm1lfbkTOGM_FalGwhhd5zSTDrGDLxSpjXLYzLWrUvkyWT8lyN_v_V6qSZYxleb5mGecZTxnDopF5W-RFvqbdZJEhffV0Guuk1nUzV44lqQeeglr54P8GhfeqI91uDIMKGstq9Iy0GIUPIKScmhjd82Cb2UiuHJn9Aaf0u8c>53258</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang does not add debuginfo for stderr
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          billionai
      </td>
    </tr>
</table>

<pre>
    Consider the following code:

```
#include <stdio.h>
int main(){
  fprintf(stderr, "test\n");
  return 0;
}
```

Compiling this code with `gcc -g` and examining the debug information with `readelf -w` shows the following information for stderr:

```
<1><263>: Abbrev Number: 14 (DW_TAG_variable)
    <264>   DW_AT_name        : (indirect string, offset: 0x7b): stderr
    <268>   DW_AT_decl_file   : 6
    <269>   DW_AT_decl_line   : 139
    <26a>   DW_AT_decl_column : 14
    <26b>   DW_AT_type        : <0x25e>
    <26f>   DW_AT_external    : 1
    <26f>   DW_AT_declaration : 1
```

Whereas compiling with clang give no information for stderr.

This is a problem when trying to use dprintf as an fprintf(stderr, ...) to debug clang-compiled code on GDB, as it complains that stderr has no defined typed and a casting would need to be done. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VE2T4iAQ_TXx0mUqAb9yyMGJu3Pb01TN0SKhk7CFYAFR599vk6jruLNjURHo153H60dqKz_KyhqvJDoIPUJrtbZnZTporMSEb5Nsl2S35yq7jmnJuDKNHiRCwisfpLJpn_AfU1SZAAehTMI2CSuS9cu0DdAeHcVa2qcUdC5hFSSMBfQhWVaEZxHP73iHYXAGsvtWst59zWd8VvZwVDqeIPTKj8eAswo9EK5rGph3NAFhJOBFHJSZkAgS66EDZVrrDiIoa-5ZDoVE3cL8HDN9b8_-SavHLJrB9WDfq8erPIrFK7bi42QL27p2eIJfw6HGmA75gqTZ7N73b9vX_Uk4JWqNUZ6rNgBj_oLyaU647dveiAPC9RdrUAFlpHLYBCJG2ndRcdu2HkOMZ5d1PSq-vfH-XHzzWFxio_et0ngtvnoCF_-AqRU3cM6fiYt_4I3Vw8FM8MUTun5Eh4_j52PyKruwJd4NeE9rH9PwEtAZoW9p-XfgyEi4qa8P4C99994jGSUa7ua_0T9UgKadOiEY-x-jpI913qJraQg4OkvdPsC5RwPBfYxOtTB4Mut0h4DeJ8yXNypNU2pqxE_GHnnMJ3Iop2tBJF53LxFNdVQYqWu6stHeIlzJQU9BE8u01EkJUXc53h8BjfBhPKkdtASDMWyhJn7WYAozWXJZ8ELMggoay2rUQlqMBQMIKSdyUZUHOWaD02UfwtHHG8R-0uhIyqFOiSAttD7d_uak0W8yNi2V9wN6miw5W25mfVk0i1xmm7poV0Is60KwzSJrGsk3EZCvZ1rUqH2ZLF-S5W6mSpYxluX5mmWcZzxlDItG5m2RF_madpNFhvRB02l8cWpdN3PlyIFO4CmolQ_-b1B4rzqS5FZfDKG3rqyV1tR9oWYj4XJk-wen_6b1">