From 0f798012d57eac9b34b34b48857a1420a03d5688 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 16 Mar 2023 03:43:10 -0700 Subject: [PATCH] Minor fixes to 1989/tromp - now compiles cleanly Now compiles without any warnings triggered (though it has some -Wno- at the compiler). Some of the -Wno- options were removed from the Makefile as they are no longer needed. I did not check all the ones that are remaining but some are certainly needed (including some I tested). Also force use of -include stdio.h -include unistd.h -include stdlib.h by minor change to Makefile. The last one, -include stdlib.h, was newly added. --- 1989/tromp/Makefile | 13 +++++++++---- 1989/tromp/tromp.c | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/1989/tromp/Makefile b/1989/tromp/Makefile index 114b7df93..b061ac657 100644 --- a/1989/tromp/Makefile +++ b/1989/tromp/Makefile @@ -63,9 +63,9 @@ X11_INCDIR= /opt/X11/include # Common C compiler warnings to silence # #CSILENCE= -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pointer-to-int-cast \ - -Wno-no-return-type -Wno-builtin-requires-header -Wno-empty-body \ - -Wno-string-plus-int -Wno-return-type -Wno-unknown-warning-option +CSILENCE= -Wno-error -Wno-pointer-to-int-cast -Wno-no-return-type -Wno-empty-body \ + -Wno-implicit-function-declaration -Wno-string-plus-int -Wno-return-type \ + -Wno-unknown-warning-option # Common C compiler warning flags # @@ -99,7 +99,7 @@ CDEFINE= # Include files that are needed to compile # -CINCLUDE= -include stdio.h -include unistd.h +CINCLUDE= #CINCLUDE= -include stdlib.h #CINCLUDE= -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h @@ -174,6 +174,11 @@ ALT_OBJ= ${PROG}.alt.o ALT_TARGET= ${PROG}.alt +# FORCE use of -include stdio.h -include unistd.h +# +CINCLUDE+= -include stdio.h -include unistd.h -include stdlib.h + + ################# # build the entry ################# diff --git a/1989/tromp/tromp.c b/1989/tromp/tromp.c index 02e1523cf..df3dfdc6c 100644 --- a/1989/tromp/tromp.c +++ b/1989/tromp/tromp.c @@ -16,4 +16,4 @@ for(;j%12;q[j--]=0);u();for(;--j;q[j+12]=q[j]);u();}n=f+rand()%7*4;G(x=17)||(c 8192);printf("\033[H\033[J\033[0m%ld\n",w);if(c==a[5])break;for(j=264;j--;Q[j]= 0);while(getchar()-a[4]);puts("\033[H\033[J\033[7m");sigsetmask(s);}}system("\ stty cbreak echo");d=popen("cat - HI 2>/dev/null|sort -rn|head -20>/tmp/$$;mv /tmp/$$ HI\ -;cat HI","w");fprintf(d,"%4d by %s\n",w,getlogin());pclose(d);} +;cat HI","w");fprintf(d,"%4ld by %s\n",w,getlogin());pclose(d);}