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.
This commit is contained in:
Justine Tunney 2023-03-28 10:23:34 -07:00
parent cbddf4661b
commit 1631298475
No known key found for this signature in database
GPG Key ID: BE714B4575D6E328
2 changed files with 3 additions and 3 deletions

View File

@ -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

2
mmap.c
View File

@ -34,7 +34,7 @@
#ifdef NEED_POSIX_MMAP
#include <stdlib.h>
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";