[libcxx-commits] [libcxx] [libcxxabi] [libunwind] [runtimes][NFC] Consistently declare main() functions in tests (PR #162548)

Oliver Hunt via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 9 12:22:40 PDT 2025


ojhunt wrote:

> > LGTM, only question is whether this should be `const char**`
> 
> I'm not sure it's legal. You can do `char argv[]` or `char** argv` or omit it entirely: https://eel.is/c++draft/basic.start.main#2. Clang doesn't emit a diagnostic so I'm not 100% certain.
> 
> Either way, we do `char**` in the test suite consistently.

Per the spec it is not - for some reason I thought it was meant to be const `char**` - I suspect I have been writing incorrect code that just happens to work for years O_o

https://github.com/llvm/llvm-project/pull/162548


More information about the libcxx-commits mailing list