[libc-commits] [libc] [libc] Fix warning on 'extern "C" int main' in test suite (PR #102973)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Mon Aug 12 15:39:14 PDT 2024
================
@@ -43,7 +43,15 @@ TestOptions parseOptions(int argc, char **argv) {
} // anonymous namespace
-extern "C" int main(int argc, char **argv, char **envp) {
+// The C++ standard forbids declaring the main function with a linkage specifier
+// outisde of 'freestanding' mode, only define the linkage for hermetic tests.
+#ifdef LIBC_HERMETIC_TEST
----------------
jhuber6 wrote:
That's fair, good point.
https://github.com/llvm/llvm-project/pull/102973
More information about the libc-commits
mailing list