<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61675>61675</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format 16 repeatedly changes file between two versions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
omartijn
</td>
</tr>
</table>
<pre>
When I format the attached glfw3.h` header file with the given `.clang-format` file, it keeps changing between two versions every time. It looks like it is getting confused by the comment associating the `#endif`. In one version it wants to align the comment below with it, in the other version it is aligned with the comments above the `#endif.
Note: I've changed the file extensions to `.txt` because github is being obnoxious and removed the leading dot from `.clang-format` since github refuses to accept hidden files apparantly.
[glfw3.txt](https://github.com/llvm/llvm-project/files/11061197/glfw3.txt)
[clang-format.txt](https://github.com/llvm/llvm-project/files/11061206/clang-format.txt)
I'm using Debian clang-format version 16.0.0 (++20230323033156+c5b23ab2a31a-1~exp1~20230323153311.61) which was the latest as-of this morning.
```
clang-format -i glfw3.h && md5sum glfw3.h
5f91766c110dc895309ce16bc33dadff glfw3.h
clang-format -i glfw3.h && md5sum glfw3.h
539373658f93119012002c2a4fe57385 glfw3.h
clang-format -i glfw3.h && md5sum glfw3.h
5f91766c110dc895309ce16bc33dadff glfw3.h
clang-format -i glfw3.h && md5sum glfw3.h
539373658f93119012002c2a4fe57385 glfw3.h
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVU2P4jgQ_TXmUiLyR-KQQw7NtpD6stc9-6OSeDqxUexAc5nfvnLSMM3uXPbjMBIYAVWvXr165agYXe8RW1IdSfW6U0sawtyGSc3JffM7Heyt_WNAD2_QhXlSCdKAoFJSZkAL_dhdRTEQSWFAZXGGzo0IV5eGNbB3F_RAJC3MqHy_3zByeI4j_DdwCd4RzxHMoHzvfA8a0xXRQ7oGuOAcXfAR8ILzDZKbsIC3BGMI7xFG944ZwEXoMaWcbILvlogW9G0lYMI0oU-gYgzGqTUm_04kJVygt67L7ODNQ_B4r5dBr8qnCCmAGl3vn8A0juG6NenS2sT2f0gDzl8xXNyy0f6Q5BMkgtLhgn8lUxD6SujLdv4eEhLxAm-E1xfcFEK7pqwy40dCv-mTwqpy-ljF1WjUErP8aVh0pqExdx60Dx8uLBGUtzDjFC6feCMqmyNsSNDNYfrpzKLz5gE6YxZ6U8gYPCcYnLXoV2oR1PmsZuXTeLu3VB03t2SO1SvhhyGlcyTihfAT4acNtjBhIvw0jpf7x_48h29oEuGnFZnwE2NUMtbUOesByZtHna-8_69ynErCT39DflRdzzyoCZaYlXxF7ZSHrxkPazBZ0IIC4QfCj4QfOeWCivwWrJKEH02luVCaK8HUnn3HjzP7fg9ilRCMFZIR3sB1cGaAq4rbFFXCmM2-Dx2kwUWYwuyd759sle22vdavTwz37r7TQLgkXMJkq7hMj01fU6quYbWUhjFqzaGpBG0MMqmNEFbZroPn8H9TQTSiFrI6dI1grKGMU8oNV2WHVS0O1X8v8Iu18BjKzrbCNqJRO2yZrBtZlU1d7YZWlFo0qq7RSFNa2unSGMqxMcIKpvVh59pPi5SMlo2oioPshJH8UDW2rE3ZkZLipNxYZKMXYe53LsYFW8lkXe1GpXGM9yfB3K7boJc-kpKOLqb4Iy25NGL7pAmTMOMZVUI73j6vqrhdUz-70HfLPLb_eCNXunklV8Z_BgAA__99VCLp">