ref: 94a3394c37862c6c997a735d1c0ec6d580226627
parent: 3c5ec3c8bb3853c5017463302b55c892961bccab
author: Marc-Alexandre Espiaut <marc-alexandre.espiaut@etu.u-bordeaux.fr>
date: Mon Jun 4 20:48:48 EDT 2018
Fixing Makefile to: only optimize without compromizing debugging; following the latest C17 standard; display more warnings.
--- a/rott/Makefile
+++ b/rott/Makefile
@@ -14,10 +14,10 @@
# Regular build flags and rules
-CC ?= gccs
+CC ?= gcc
-CFLAGS ?= -g -O2
-CFLAGS += -Wall -Wno-unused
+CFLAGS ?= -std=c17 -g -Og
+CFLAGS += -Wall -Wextra -Wshadow -Wpedantic
CFLAGS += $(shell sdl2-config --cflags)
CFLAGS += $(EXTRACFLAGS)
--- a/rott/audiolib/Makefile
+++ b/rott/audiolib/Makefile
@@ -6,8 +6,8 @@
ARFLAGS ?= rcT
-CFLAGS ?= -g -O2
-CFLAGS += -Wall
+CFLAGS ?= -std=c17 -g -Og
+CFLAGS += -Wall -Wextra -Wshadow -Wpedantic
CFLAGS += $(shell sdl-config --cflags)
OBJS :=
--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -1149,8 +1149,7 @@
// Write Battle File
GetPathFromEnvironment( filename, ApogeePath, BattleName );
- file = open( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC,
- S_IREAD | S_IWRITE );
+ file = open( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC );
if ( file == -1 )
{
@@ -1508,8 +1507,7 @@
}
GetPathFromEnvironment( filename, ApogeePath, SoundName );
- file = open ( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC,
- S_IREAD | S_IWRITE);
+ file = open ( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC );
if (file == -1)
Error ("Error opening %s: %s", filename, strerror(errno));
@@ -1623,8 +1621,7 @@
WriteBattleConfig();
GetPathFromEnvironment( filename, ApogeePath, ConfigName );
- file = open( filename,O_RDWR | O_TEXT | O_CREAT | O_TRUNC
- , S_IREAD | S_IWRITE);
+ file = open( filename,O_RDWR | O_TEXT | O_CREAT | O_TRUNC );
if (file == -1)
Error ("Error opening %s: %s",filename,strerror(errno));
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -582,8 +582,7 @@
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
- handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_APPEND
- , S_IREAD | S_IWRITE);
+ handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_APPEND );
if (handle == -1)
Error ("Error opening for append %s: %s",filename,strerror(errno));
@@ -599,8 +598,7 @@
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
- handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_TRUNC
- , S_IREAD | S_IWRITE);
+ handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_TRUNC );
if (handle == -1)
Error ("Error opening %s: %s",filename,strerror(errno));
--- a/rott/w_wad.c
+++ b/rott/w_wad.c
@@ -19,6 +19,7 @@
*/
// W_wad.c
+#include <alloca.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>