<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82321>82321</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`llvm::dwarf_linker::parallel::SectionDescriptor::OS` is constructed from uninitialized member `Contents`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Eisenwave
</td>
</tr>
</table>
<pre>
I got the following warning when compiling LLVM with g++:
```
In file included from /home/user/projects/llvm-project/llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.h:13,
from /home/user/projects/llvm-project/llvm/lib/DWARFLinker/Parallel/DIEGenerator.h:13,
from /home/user/projects/llvm-project/llvm/lib/DWARFLinker/Parallel/DIEAttributeCloner.h:13,
from /home/user/projects/llvm-project/llvm/lib/DWARFLinker/Parallel/DIEAttributeCloner.cpp:9:
/home/user/projects/llvm-project/llvm/lib/DWARFLinker/Parallel/OutputSections.h: In constructor ‘llvm::dwarf_linker::parallel::SectionDescriptor::SectionDescriptor(llvm::dwarf_linker::DebugSectionKind, llvm::dwarf_linker::parallel::LinkingGlobalData&, llvm::dwarf::FormParams, llvm::endianness)’:
/home/user/projects/llvm-project/llvm/lib/DWARFLinker/Parallel/OutputSections.h:157:67: warning: member ‘llvm::dwarf_linker::parallel::SectionDescriptor::Contents’ is used uninitialized [-Wuninitialized]
157 | : SectionDescriptorBase(SectionKind, Format, Endianess), OS(Contents),
|
```
This looks to be a true positive because:
https://github.com/llvm/llvm-project/blob/119a72866f0e143127355fe6e03f57c4f8bab1ae/llvm/lib/DWARFLinker/Parallel/OutputSections.h#L155-L157
`OS` is declared prior to `Contents`:
https://github.com/llvm/llvm-project/blob/119a72866f0e143127355fe6e03f57c4f8bab1ae/llvm/lib/DWARFLinker/Parallel/OutputSections.h#L184-L185
https://github.com/llvm/llvm-project/blob/119a72866f0e143127355fe6e03f57c4f8bab1ae/llvm/lib/DWARFLinker/Parallel/OutputSections.h#L290-L291
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVk2P2zYQ_TXUhbBBjb6ogw5aexUs6mKLbtscC0oaS2woUiCpNdpfX1Bre-M0LfqRtokhWJyhOXxv3nBM4ZwcNGJFsjuS7SOx-NHY6l461CfxjFFr-p-rBzoYT_2I9GiUMiepB3oSVq_vETXtzDRLFczD4Yev6Un6kQ4E7sKT1ITtCatJzs7Paj5oepQKqdSdWnrs6dGaiRJoRjMhgWZxaAk0szU_YecdgUap52lzts9meMmWQLN_W3_bHKR-ty76RlihFKrbie-19NuRJHWcENi9oKAffv4lFA_3b1CjFd7Y_w9C7b2V7eJxp4zGzwhIN88kqcvXUvnUez4ufl78E3ZeGu1W4vQhlK123i6dN5aSeyCckZKvEZOaJHV_Evb4o3qJt3rmS8jVOsfbo-usnL2xv-eGPwy6x3YZzou-kronsKN_HkSgK_XwRplWqL3wgkD-kQgvw8bYKaRlcrc_Qd1LoTU6R6C8ZOK_1SPOCpLUefi69JYwnHBq8VOqszPao_buypJKRxeHPV201NJLoeQv2FOS3W3e3rhItr8clDgrKCl253MScP5mtzvhkAD_QNcggPBhdL-m_Jxx2NHHJwL8Cm71vX8sSbH7aBv9bpSOKmPeOeoNbZEK6u2CdDZOevmMtMVOLA6vWo7ezy5Y0BBoBunHpd12ZnpPu1tFW2WClnFcigJ4nh8ZxmkSQ5Fk2RFzZMkxK7r0yFvRxgL_fg1AcoizbHMIlfBC9UL48YnkLOjUY6eExZ7OVhobGJOcXZOWs9eK_QK48nRziHn2xQCGkm0OUMZRXyV9mZQiwiouGE_jMikgGquwE4ec8zbFjgveY1x0WHCWZpDwOI9kBQxSBsAYz_IYtm2G0OcCEt7yEouUpAwnIdU2oNwaO0TSuQUrDgnEkRItKrdeVQA0nug6SQDCzcVWa2raZXAkZUo6716jeOkVViRn_7h9XEvx-t9xubrcto9L37opz2ixqvrLGq8sQ6tds_BrAAAA__8owwrT">