PDP-10 / its

Incompatible Timesharing System
Other
834 stars 80 forks source link

Build failure with gcc 14.1.1 #2309

Closed parkerlreed closed 1 month ago

parkerlreed commented 1 month ago

Arch Linux gcc 14.1.1+r58+gfc9fb69ad62-1

[parker@rogally its]$ make all EMULATOR=pdp10-ka
git submodule sync --recursive `dirname tools/pdp6/.gitignore`
Synchronizing submodule url for 'tools/pdp6'
git submodule update --recursive --init `dirname tools/pdp6/.gitignore`
make -C tools/tv11 xgp11 CFLAGS=-O3
make[1]: Entering directory '/home/parker/.local/build/its/tools/tv11'
cc -O3   -c -o xgp11.o xgp11.c
xgp11.c:96:1: warning: conflicting types for built-in function ‘log’; expected ‘double(double)’ [-Wbuiltin-declaration-mismatch]
   96 | log (char *format, ...)
      | ^~~
xgp11.c:19:1: note: ‘log’ is declared in header ‘<math.h>’
   18 | #include <stdarg.h>
  +++ |+#include <math.h>
   19 | 
cc -O3   -c -o xgp.o xgp.c
cp lodepng/lodepng.h lodepng.h
cc -O3   -c -o print.o print.c
cp lodepng/lodepng.cpp lodepng.c
cc -O3   -c -o lodepng.o lodepng.c
cc -O3   -c -o meatball.o meatball.c
cc -O3 -o xgp11 xgp11.o xgp.o ka11.o eae.o kw11.o kl11.o mem.o unix.o util.o print.o lodepng.o meatball.o -lpthread -lm
make[1]: Leaving directory '/home/parker/.local/build/its/tools/tv11'
make -C tools/pdp6/emu
make[1]: Entering directory '/home/parker/.local/build/its/tools/pdp6/emu'
cc -o pdp6 -g -O3 -Wall -Wno-parentheses  `sdl2-config --cflags` `pkg-config SDL2_image --cflags` -DGRAPHICS main_panel.c dis340.c joy.c emu.c apr.c mem.c tty.c pt.c dc.c dt.c netmem.c netcons.c cmd.c util.c threading.c rtc.c ../tools/pdp6common.c -lpthread -lm `sdl2-config --libs` `pkg-config SDL2_image --libs`
main_panel.c:792:1: warning: ‘drawgrid’ defined but not used [-Wunused-function]
  792 | drawgrid(Grid *g, SDL_Texture *s, Uint32 col)
      | ^~~~~~~~
dis340.c: In function ‘renderthread’:
dis340.c:835:19: warning: unused variable ‘ev’ [-Wunused-variable]
  835 |         SDL_Event ev;
      |                   ^~
joy.c: In function ‘cscope_plot’:
joy.c:132:25: error: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
  132 |                         close(fd);
      |                         ^~~~~
      |                         pclose
apr.c:137:1: warning: ‘tracechange’ defined but not used [-Wunused-function]
  137 | tracechange(Apr *apr)
      | ^~~~~~~~~~~
apr.c:124:1: warning: ‘pprint’ defined but not used [-Wunused-function]
  124 | pprint(Apr *apr)
      | ^~~~~~
make[1]: *** [Makefile:16: pdp6] Error 1
make[1]: Leaving directory '/home/parker/.local/build/its/tools/pdp6/emu'
make: *** [Makefile:395: tools/pdp6/emu/pdp6] Error 2
parkerlreed commented 1 month ago

Maybe just needs to be fclose?

https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1961818.html

atsampson commented 1 month ago

It needs #include <unistd.h> to get the prototype of close. GCC 14 makes missing prototypes a fatal error by default (along with various other things that used to be warnings).

parkerlreed commented 1 month ago

Thanks! That worked added to joy.c. No other errors.

larsbrinkhoff commented 1 month ago

Please consider posting a pull request for fixing this.

stevefalco commented 2 weeks ago

I created a pull request for the same problem:

https://github.com/aap/pdp6/pull/32

Hopefully @aap will pick up the change.