aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-02-20 21:33:44 +0100
committerMattias Andrée <maandree@kth.se>2021-02-20 21:33:44 +0100
commit10d71adfc47091a62ad9b937943c312c1baf20af (patch)
treee536fb74a2b473544b37c5f7c3538ab19af90870
parentMake code nice (diff)
downloadhungarian-algorithm-n3-10d71adfc47091a62ad9b937943c312c1baf20af.tar.gz
hungarian-algorithm-n3-10d71adfc47091a62ad9b937943c312c1baf20af.tar.bz2
hungarian-algorithm-n3-10d71adfc47091a62ad9b937943c312c1baf20af.tar.xz
Use c99
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--.gitignore13
-rw-r--r--Makefile24
-rw-r--r--hungarian.c1
3 files changed, 10 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 78116e5..ffb6bda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,4 @@
-/hungarian
*~
-\#*\#
-.*
-!.git*
-*.bak
-*.swp
-*.swo
+*#*
*.su
-*.o
-*.out
-*.gch
-
+/hungarian
diff --git a/Makefile b/Makefile
index 2023518..9f060d7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,17 @@
-OPTIMISE = -Og -g
-WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
- -Wtrampolines -Wfloat-equal -Wshadow -Wmissing-prototypes -Wmissing-declarations \
- -Wredundant-decls -Wnested-externs -Winline -Wno-variadic-macros -Wsync-nand \
- -Wunsafe-loop-optimizations -Wcast-align -Wstrict-overflow \
- -Wundef -Wbad-function-cast -Wcast-qual -Wwrite-strings -Wlogical-op -Waggregate-return \
- -Wstrict-prototypes -Wold-style-definition -Wpacked -Wvector-operation-performance \
- -Wunsuffixed-float-constants -Wsuggest-attribute=const -Wsuggest-attribute=noreturn \
- -Wsuggest-attribute=pure -Wsuggest-attribute=format -Wnormalized=nfkc -Wconversion \
- -fstrict-aliasing -fstrict-overflow -fipa-pure-const -ftree-vrp -fstack-usage \
- -funsafe-loop-optimizations -Wdeclaration-after-statement
+.POSIX:
+
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700
+CFLAGS = -std=c99 -g
+LDFLAGS =
all: hungarian
hungarian: hungarian.c
- gcc -std=gnu99 $(OPTIMISE) $(WARN) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -o $@ $<
-
-test: hungarian
- ./hungarian
+ gcc -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
clean:
-rm -f -- hungarian
-.PHONY: all test valgrind clean
-
+.PHONY: all clean
diff --git a/hungarian.c b/hungarian.c
index 38c9f55..faf7243 100644
--- a/hungarian.c
+++ b/hungarian.c
@@ -11,6 +11,7 @@
*/
+#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>