From 163129847511366077ec52beca2312f95a87e182 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 28 Mar 2023 10:23:34 -0700 Subject: [PATCH] Remove -std=foo compiler flags These flags are only really useful for linting. They put GCC and other compilers into `__STRICT_ANSI__` mode. That can make systems stuff slower, in favor of standards conformance, since it may cause headers to remove platform specific goodness. It also makes builds more painful on old distros that have the functions we need, but track an older version of the standards where those functions weren't strictly available. One such example is mkstemp(). It's available everywhere in practice, but GA Ubuntu in strict ansi mode complains about it. If we don't use mkstemp() then that'll put us on the security radar with other platforms. --- Makefile | 4 ++-- mmap.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 044e7d7fe..8f94c77af 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ endif # Compile flags # -CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC -CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC +CFLAGS = -I. -O3 -DNDEBUG -fPIC +CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -fPIC LDFLAGS = # OS specific diff --git a/mmap.c b/mmap.c index d9ceb3348..1abb44799 100644 --- a/mmap.c +++ b/mmap.c @@ -34,7 +34,7 @@ #ifdef NEED_POSIX_MMAP #include -static void *PosixMmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { +void *PosixMmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { int tfd; void* res; char path[] = "/tmp/llama.dat.XXXXXX";