<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123492>123492</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy android-cloexec-fopen docs should say if `e` is safe across platforms
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
seanm
</td>
</tr>
</table>
<pre>
The docs for `android-cloexec-fopen` here:
https://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-fopen.html
say only "fopen() should include `e` in their mode string; so `re` would be valid. This is equivalent to having set FD_CLOEXEC on that descriptor."
By having "android" in the check's name, one assumes this works on Android.
The macOS 10.13 through 15.3 man pages say `e` is supported.
Not sure about Windows, linux, the BSDs, or others.
But most important of all: is it known that adding `e` would be harmless/ignored on all OSes? If it's not knowm, it's risky to just add an `e` in cross-platform code, because maybe the `e` would break some implementations of fopen.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU01v4zYQ_TX0ZWBBovwRHXSIN2ugQNEcskB7K0bkWOKa4rgcyon_fUFZySZFAQMWP-bNe2_4UMT1gahV24PaPq1wSgPHVgjDuOrY3tofA4FlI3DiCGpXYrCRnV0bz_RGZn3iCwW1K2GgSKp-VGX-DSldJK_0Uemj8Rj6wvvrWHDslT7SW4r4frBOzt7yYiBzFqWPS4v5_FOTYkijv8ML3oCDv4HS-k5APyjdgAw8eQsuGD9ZynQpU3MB0kAuwsiWQFJ0oVf1AYTzlTjfeZ0rO4IremcL-DE4ASdA_0zuip5CgsQw4NWFHoQSHJ_-_vb78_e_vn8DzviYwJKY6C6JY6G0vlM93N6LlNYfyvTCCWbRSu8FAo6kdAYjQJFpJIGUSbxyPEvu8XivLu7AeTAjmucXqMqiqiENkad-gGpb1DBigAv2JJCt-vBBQKbLhWOid5Q_OIFMkQA7nhL86YLlV8k8vAvTW_7INA8vT_MmR-A0UJSl_DAlGFkSuDHDYkjAJ0DvVf2Y27kE58Cviz9o7WzEQufD8gHj6Eny7F0fOJLNctF7eH4hUfUR4LcTuHT3ie-YY-az7EUn51uez89J5jaA4fP0TWSR9cVjOnEcwbCdre7I4CTZxltHs87_UIuEZxAeKevzNFJImBwHySrvj3Jl29o2dYMraqt9vdebfVNvV0PbVHZXY1XuzWavdxof9s2m6cxmb7DcdR2uXKtLvS2rqinLra62Rbcz1aYuqz0-mOpUNmpT0ojOfyRn5UQmaitdbxq98tiRlzm5Wn9Oks5Jjm2uWndTL2pTeidJfuEklzy1v2rgf1N9z_2SqfyO3OnLU8ITAc7Wwru1spqib7-mv3dpmLrC8Kj0MVNY_taXyD_JpDz1rCuPf5F2bfW_AQAA___sO4KV">