alexfh wrote:

Hi @a-tarasyuk, it looks like this patch introduces a couple of problems. I 
guess, this boils down to marking the declaration of main() invalid in case 
it's declared with `extern "C"`, but I may be wrong here.

The first problem is a clang crash: https://gcc.godbolt.org/z/dWETErhzM

The second one is a change of behavior of code that declares `main()` `extern 
"C"` (see my comment 
https://github.com/llvm/llvm-project/commit/37ec6e5f12afe4a37872bf28f280423696f39019#r145380228).
 This one still needs some work to create a standalone repro for, but I suspect 
that both issues are related to marking the declaration invalid.

The problem with both cases is that in some codebases the non-trivial amount of 
cleanup is necessary for this, but Clang doesn't allow to retain the old 
behavior by just ignoring the diagnostic (`-Wno-main`). Even if the diagnostic 
is not issued, the issues above still manifest.

Please fix this ASAP or revert the patch, if it requires non-trivial / 
controversial changes or further discussion.

Thanks!

https://github.com/llvm/llvm-project/pull/101853
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to