From 44ebf376177a4e7f06e0cb4a6cb660b9f232d4eb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 13 Jan 2015 22:05:06 -0800 Subject: Tightening the compilation. - Provide prototypes for the deciders, so they are diagnosed if incorrect. - Add some compiler language and diagnostic options. --- genprog.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/genprog.sh b/genprog.sh index 2d0a1e4..3b76ad1 100755 --- a/genprog.sh +++ b/genprog.sh @@ -28,6 +28,8 @@ set -e # stop on any errors MYDIR=$(dirname "$0") +CFLAGS="-Wall -W -ansi -Wno-unused -Wstrict-prototypes -Wmissing-prototypes" + . "$MYDIR"/lib.sh if [ $# != 2 ] ; then @@ -61,6 +63,9 @@ cat > ${PROGRAM_BASENAME}.c < #include "ternary.h" +ternary halting_decider(const char *, const char *); +int error_decider(const char *, const char *, const char *); + #define HD_HASH "$HD_HASH" #define ED_HASH "$ED_HASH" #define PG_BASE "$PROGRAM_BASENAME" @@ -115,7 +120,7 @@ int main(int argc, char **argv) ! printf "compiling %s to %s\n" $PROGRAM_BASENAME.c $PROGRAM_BASENAME -gcc $PROGRAM_BASENAME.c -o $PROGRAM_BASENAME +gcc $CFLAGS $PROGRAM_BASENAME.c -o $PROGRAM_BASENAME printf "\n" -- cgit v1.2.3