]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add PEDANTIC and CONFIG_PEDANTIC to compile as standard c11 if desired.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Jun 2020 15:00:02 +0000 (15:00 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Jun 2020 15:00:02 +0000 (15:00 +0000)
Usage:
make <target> [-jN] PEDANTIC=1

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12760 d7cf8633-e32d-0410-b094-e92efae38249

makefile.inc
prvm_exec.c

index 2d83af48472faf6a74194b4f700d105b480da353..fd5792d68cfa221b8fc1639359da31dc1ebe3fdf 100644 (file)
@@ -172,8 +172,12 @@ OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_MENU) $(OBJ_SND_COMM
 
 
 # Compilation
-CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_SND_XMP) $(CFLAGS_NET) $(CFLAGS_SDL) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
-# CFLAGS_STANDARD=-D_POSIX_C_SOURCE=200112L -std=c11 -pedantic
+ifeq ($(PEDANTIC),1)
+       CFLAGS_STANDARD=-std=c11 -pedantic -D_POSIX_C_SOURCE=200809L -DCONFIG_PEDANTIC
+else
+       CFLAGS_STANDARD=
+endif
+CFLAGS_COMMON=$(CFLAGS_STANDARD) $(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_SND_XMP) $(CFLAGS_NET) $(CFLAGS_SDL) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
 CFLAGS_CLIENT=-DCONFIG_MENU $(CFLAGS_VIDEO_CAPTURE)
 CFLAGS_SERVER=
 CFLAGS_DEBUG=-ggdb
index b6766757d5a38dfb358b90564a525c5598f2b30e..d4cf0d830610c8f59828bc2e60fcf3fef8f8ed54 100644 (file)
@@ -716,8 +716,10 @@ static void PRVM_StatementCoverageEvent(prvm_prog_t *prog, mfunction_t *func, in
        Con_Printf("prvm_coverage: %s just executed a statement at %s for the first time. Coverage: %.2f%%.\n", prog->name, PRVM_WhereAmI(vabuf, sizeof(vabuf), prog, func, statement), prog->statements_covered * 100.0 / prog->numstatements);
 }
 
-#if defined (__GNUC__) && (_GNU_SOURCE)
-#define HAVE_COMPUTED_GOTOS 1
+#if defined (__GNUC__) || (__clang__)
+#  ifndef CONFIG_PEDANTIC
+#  define HAVE_COMPUTED_GOTOS 1
+#  endif
 #endif
 
 #define OPA ((prvm_eval_t *)&prog->globals.fp[st->operand[0]])