Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libc: Remove extern "C" from main declarations #102825

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libc/benchmarks/gpu/LibcGpuBenchmarkMain.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "LibcGpuBenchmark.h"

extern "C" int main(int argc, char **argv, char **envp) {
int main(int argc, char **argv, char **envp) {
LIBC_NAMESPACE::benchmarks::Benchmark::run_benchmarks();
return 0;
}
2 changes: 1 addition & 1 deletion libc/startup/gpu/amdgpu/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"

extern "C" int main(int argc, char **argv, char **envp);
int main(int argc, char **argv, char **envp);

namespace LIBC_NAMESPACE_DECL {

Expand Down
2 changes: 1 addition & 1 deletion libc/startup/gpu/nvptx/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"

extern "C" int main(int argc, char **argv, char **envp);
int main(int argc, char **argv, char **envp);

namespace LIBC_NAMESPACE_DECL {

Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/do_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sys/mman.h>
#include <sys/syscall.h>

extern "C" int main(int argc, char **argv, char **envp);
int main(int argc, char **argv, char **envp);

extern "C" {
// These arrays are present in the .init_array and .fini_array sections.
Expand Down
2 changes: 1 addition & 1 deletion libc/test/IntegrationTest/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@
// tests, then we should not need to explicitly declare/define the main
// function in individual integration tests. We will not need this macro
// then.
#define TEST_MAIN extern "C" int main
#define TEST_MAIN int main

#endif // LLVM_LIBC_UTILS_INTEGRATION_TEST_TEST_H
2 changes: 1 addition & 1 deletion libc/test/UnitTest/LibcTestMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TestOptions parseOptions(int argc, char **argv) {

} // anonymous namespace

extern "C" int main(int argc, char **argv, char **envp) {
int main(int argc, char **argv, char **envp) {
LIBC_NAMESPACE::testing::argc = argc;
LIBC_NAMESPACE::testing::argv = argv;
LIBC_NAMESPACE::testing::envp = envp;
Expand Down
2 changes: 1 addition & 1 deletion libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool TestGeneratorMain(llvm::raw_ostream &OS, llvm::RecordKeeper &records) {

OS << '\n';

OS << "extern \"C\" int main() {\n";
OS << "int main() {\n";
for (const auto &entrypoint : EntrypointNamesOption) {
if (entrypoint == "errno")
continue;
Expand Down
Loading