From bd52a4c5d547e10ae572bf8e987142cbf6aba334 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 20 May 2018 16:16:46 -0400 Subject: [PATCH] create C files with ".c" suffix --- src/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index eff5ec3..e7835d7 100644 --- a/src/main.cc +++ b/src/main.cc @@ -8,7 +8,7 @@ #include static char preprocessed_fname[] = "/tmp/cxlppXXXXXX"; -static char c_fname[] = "/tmp/cxlcXXXXXX"; +static char c_fname[] = "/tmp/cxlcXXXXXX.c"; static bool preprocessed_fname_created = false; static bool c_fname_created = false; @@ -71,7 +71,7 @@ void write_node(FILE * file, Node * node) bool emit_c(Node * node) { - int fd = mkstemp(c_fname); + int fd = mkstemps(c_fname, 2); if (fd < 0) { perror("mkstemp"); @@ -94,7 +94,7 @@ bool compile() } else if (pid == 0) { - execlp("gcc", "gcc", "-x", "c", "-c", c_fname, "-o", "out.o", NULL); + execlp("gcc", "gcc", "-c", c_fname, "-o", "out.o", NULL); } else {