<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60411>60411</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            avoid `modernize-avoid-c-arrays` with `main` style parameters
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```cpp
extern int main_impl(int, char *[]);

int main(int argc, char *argv[])
{
    return main_impl(argc, argv);
}
```
```
<source>:1:27: warning: do not declare C-style arrays, use std::array<> instead [modernize-avoid-c-arrays]
extern int main_impl(int, char *[]);
 ^
```
https://godbolt.org/z/h7PT3aKnE

The check is obviously there to avoid continuous usage of those unsafe parameters but if you implement the handling into `main()` directly that would still be the case.

But you cannot simply convert it a `std::array` and need some template function to generate that which each application would have to implement by itself. And even then you need to suppress the warning on the conversion function.

So I think it would make sense to be able to avoid the warning on those exact parameters. It is probably a common pattern (Boost and googletest offer custom `main` implementations IIRC).

You could also make this optional via a "do not warn on main-like" option which is disabled by default to enforce better safety out-of-the-box.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2P4zYM_TXKhUigyBsnOfiQ-Qgw6KVo99JTQUu0rY4sGRKV2eyvL2RnOpnt9lQgSBzbj-89PoqYku09USN2D2L3tMLMQ4hNZyO94YVWbTDXRtRy-ehpEvJJyBN9Y4oerGcY0fo_7Tg5oQ7Ws1CPoAeMINRpqSnUUVQPC275foctCMDY63sYxv7yAV1w-1sBAIBInKP_RPxeYobe8-2fbhfvFn7-t3pMIUdNonoW1WkrqpPai-oEbxi99X25NAF8YDCkHUaCx3XiqyPAGPGaCndOBImNqE6iOs23RfUoqmewPjGhAbF7GIOh6O13WuMlWLPW6xt-9_T_Ggti9_xTawPzlIomdRbq3AfTBsebEHuhzt-FOg_7X79W-It_vg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