home · contact · privacy
Enforce C11 via Makefile, explicate POSIX dependencies in source files.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 26 Mar 2014 20:10:38 +0000 (21:10 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 26 Mar 2014 20:10:38 +0000 (21:10 +0100)
Makefile
src/client/draw_wins.c
src/client/interface_conf.c
src/client/io.c
src/client/main.c
src/client/windows.c
src/server/init.c

index 39414e54eb96293a5e945cebffee36da9fafd4e3..96c3aca017841681d83132c3a49771eb9c4707d2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Wextra -Werror -Wformat-security -g
+CFLAGS=-std=c11 -pedantic-errors -Wall -Werror -Wextra -Wformat-security -g
 TARGET_SERVER=roguelike-server
 TARGET_CLIENT=roguelike-client
 SRCDIR=src
index ed7815e8aac2f4357bb260436855a26fc40177fc..e31dcc4c375f0395b63d97dd8a043dde58bb2bdf 100644 (file)
@@ -1,5 +1,6 @@
 /* src/client/draw_wins.c */
 
+#define _POSIX_C_SOURCE 200809L /* strdup() */
 #include "draw_wins.h"
 #include <ncurses.h> /* typedefs attr_t, chtype, define A_REVERSE */
 #include <stddef.h> /* NULL */
index 57dff9a50f06a6b823e1b0583dad088468d0e722..c668376a44c42f63e7df11399634ff63afb3e454 100644 (file)
@@ -1,5 +1,6 @@
 /* src/client/interface_conf.c */
 
+#define _POSIX_C_SOURCE 2 /* getopt(), optarg */
 #include "interface_conf.h"
 #include <ncurses.h> /* delwin() */
 #include <stdint.h> /* uint8_t, uint32_t */
index 477700f9df096e522781a450bce93b3a59bf7b39..1995b14a67aca61f74fb9b710ebaa33a13169b89 100644 (file)
@@ -1,5 +1,6 @@
 /* src/client/io.c */
 
+#define _POSIX_C_SOURCE 1 /* PIPE_BUF */
 #include "io.h"
 #include <limits.h> /* PIPE_BUF */
 #include <ncurses.h> /* halfdelay(), getch() */
index a0cb82c6b93f22e8db4313661b729c9d52bdf555..569d6f6ccfa2e92627eba39fcbcfad767d9d5cfa 100644 (file)
@@ -1,5 +1,6 @@
 /* main.c */
 
+#define _POSIX_C_SOURCE 1 /* struct sigaction, sigaction() */
 #include <ncurses.h> /* keypad() */
 #include <signal.h> /* struct sigaction, sigaction() */
 #include <stddef.h> /* NULL */
index 28654b4b6c28ddd12fe2d78fbeaef4a002296700..e84d652554c74ba12face4114501818193f500ad 100644 (file)
@@ -1,5 +1,6 @@
 /* src/client/windows.c */
 
+#define _POSIX_C_SOURCE 200809L /* strnlen() */
 #include "windows.h"
 #include <ncurses.h> /* chtype, getmaxx(), getmaxy(), erase(), werase(),
                       * endwin(), delwin(), wnoutrefresh(), pnoutrefresh(),
index 3bbd5035c6fa2f4c1bb5e10424db0619f6e64a35..3a83c34025d53ff56f74b23bb423a368fb9ee306 100644 (file)
@@ -1,5 +1,6 @@
 /* src/server/init.c */
 
+#define _POSIX_C_SOURCE 2 /* getopt(), optarg */
 #include "init.h"
 #include <errno.h> /* global errno, EEXIST */
 #include <stddef.h> /* NULL */