Add braces around SYS_DEV.val array initializers#535
Add braces around SYS_DEV.val array initializers#535LegalizeAdulthood wants to merge 1 commit intoopen-simh:masterfrom
Conversation
|
This proposed change is yet another example of how the current CMake build mechanisms is deviating from functionality which works without producing any warnings when building on Linux with the makefile. Rather than changing code to accommodate the CMake configuration, this problem can be solved by changing the CMake build configuration. |
|
Go away. This has nothing to do with CMake. |
Below are the makefile build of the simulator you are changing in this PR. None have any build issues, but you can look for yourself. Below that is the Windows Legacy command line build of the same simulator using Visual Studio 2022. If you bother to look, NONE of them have a problem or report warnings or errors. You claim "This has nothing to do with CMake". CMake is fantastic. The information that is configuring it's execution must have something to do with your very different observations. On macOS, building with make produces: mark@marks-mac-mini open-simh % git pull *** intel-mds Simulator being built with: *** git commit id is 4d38373. gcc -std=c99 -U__STRICT_ANSI__ -O2 -DNDEBUG=1 -fno-strict-overflow -finline-functions -DSIM_GIT_COMMIT_ID=4d38373206cd7c0ce8b94f5e16bd4429cb96430f -DSIM_GIT_COMMIT_TIME=2025-10-12T07:58:51+0200 -DSIM_COMPILER="Apple clang version 17.0.0" -DSIM_BUILD_TOOL=simh-makefile -I . -Werror -D_GNU_SOURCE -DHAVE_PCRE_H -DHAVE_SYS_IOCTL -DSIM_HAVE_DLOPEN=dylib -DHAVE_EDITLINE -DHAVE_UTIME -DHAVE_LIBPNG -DHAVE_ZLIB -DHAVE_GLOB -DHAVE_SHM_OPEN ./Intel-Systems/common/i8080.c ./Intel-Systems/Intel-MDS/imds_sys.c ./Intel-Systems/common/i3214.c ./Intel-Systems/common/i8251.c ./Intel-Systems/common/i8253.c ./Intel-Systems/common/i8255.c ./Intel-Systems/common/i8259.c ./Intel-Systems/common/ieprom.c ./Intel-Systems/common/ioc-cont.c ./Intel-Systems/common/ipc-cont.c ./Intel-Systems/common/iram8.c ./Intel-Systems/common/isbc064.c ./Intel-Systems/common/isbc202.c ./Intel-Systems/common/isbc201.c ./Intel-Systems/common/isbc206.c ./Intel-Systems/common/isbc464.c ./Intel-Systems/common/isbc208.c ./Intel-Systems/common/port.c ./Intel-Systems/common/irq.c ./Intel-Systems/common/multibus.c ./Intel-Systems/common/mem.c ./Intel-Systems/common/sys.c ./Intel-Systems/common/zx200a.c ./scp.c ./sim_console.c ./sim_fio.c ./sim_timer.c ./sim_sock.c ./sim_tmxr.c ./sim_ether.c ./sim_tape.c ./sim_disk.c ./sim_serial.c ./sim_video.c ./sim_imd.c ./sim_card.c -I ./Intel-Systems/Intel-MDS -o BIN/intel-mds -lpthread -lpcre -L/opt/homebrew/Cellar/pcre/8.45/lib/ -ledit -lpng -lz On Linux, essentially the same is produced: *** intel-mds Simulator being built with: *** git commit id is 4d38373+uncommitted-changes. gcc -std=gnu99 -U__STRICT_ANSI__ -O2 -DNDEBUG=1 -finline-functions -fgcse-after-reload -fpredictive-commoning -fipa-cp-clone -fno-unsafe-loop-optimizations -fno-strict-overflow -DSIM_GIT_COMMIT_ID=4d38373206cd7c0ce8b94f5e16bd4429cb96430f+uncommitted-changes -DSIM_GIT_COMMIT_TIME=2025-10-12T07:58:51+0200 -DSIM_COMPILER="GCC Version: 13.3.0" -DSIM_BUILD_TOOL=simh-makefile -I . -Werror -D_GNU_SOURCE -DHAVE_PCRE_H -DHAVE_SEMAPHORE -DHAVE_SYS_IOCTL -DHAVE_LINUX_CDROM -DSIM_HAVE_DLOPEN=so -DHAVE_EDITLINE -DHAVE_UTIME -DHAVE_LIBPNG -DHAVE_ZLIB -DHAVE_GLOB -DHAVE_SHM_OPEN ./Intel-Systems/common/i8080.c ./Intel-Systems/Intel-MDS/imds_sys.c ./Intel-Systems/common/i3214.c ./Intel-Systems/common/i8251.c ./Intel-Systems/common/i8253.c ./Intel-Systems/common/i8255.c ./Intel-Systems/common/i8259.c ./Intel-Systems/common/ieprom.c ./Intel-Systems/common/ioc-cont.c ./Intel-Systems/common/ipc-cont.c ./Intel-Systems/common/iram8.c ./Intel-Systems/common/isbc064.c ./Intel-Systems/common/isbc202.c ./Intel-Systems/common/isbc201.c ./Intel-Systems/common/isbc206.c ./Intel-Systems/common/isbc464.c ./Intel-Systems/common/isbc208.c ./Intel-Systems/common/port.c ./Intel-Systems/common/irq.c ./Intel-Systems/common/multibus.c ./Intel-Systems/common/mem.c ./Intel-Systems/common/sys.c ./Intel-Systems/common/zx200a.c ./scp.c ./sim_console.c ./sim_fio.c ./sim_timer.c ./sim_sock.c ./sim_tmxr.c ./sim_ether.c ./sim_tape.c ./sim_disk.c ./sim_serial.c ./sim_video.c ./sim_imd.c ./sim_card.c -I ./Intel-Systems/Intel-MDS -o BIN/intel-mds -lm -lrt -lpthread -lpcre -ldl -ledit -ltermcap -lpng -lz Using the Legacy build mechanism on Windows with Visual Studio 2022: ** Visual Studio 2022 Developer Command Prompt v17.14.29 [vcvarsall.bat] Environment initialized for: 'x86' C:\Program Files\Microsoft Visual Studio\2022\Community>cd \Users\Mark\Documents C:\Users\Mark\Documents>git clone https://github.com/open-simh/simh open-simh-current Cloning into 'open-simh-current'... C:\Users\Mark\Documents>cd open-simh-current C:\Users\Mark\Documents\open-simh-current>build_vstudio.bat Intel-MDS Build succeeded. Time Elapsed 00:00:23.53 |
9581a2c to
f6f62e7
Compare
|
Please go away and play in your self-licensed sandbox. This fork was created explicitly to get away from you. Braces around aggregate initializers for arrays are standard best practice. That's why a modern gcc warns you about it by default. |
|
@LegalizeAdulthood So it turns out I already fixed this, not having seen your pull request! I've been doing a systematic sweep of compiler warnings. There are still many, many thousands to go, but I keep finding real bugs because of them, so it's worth spending the time. I anticipate having the ZIMH tree fully clean of such warnings in a week or two. |
|
Yes, warnings should be properly addressed, not suppressed with compiler flags. |
|
I've found a real bugs in SIMH (including places where braces were missing after an if but the indentation was deceptive, which clang and gcc will warn about) by combing through the compiler warnings. Ignoring them is foolish. |
This eliminates thousands of lines of warnings from gcc on linux
f6f62e7 to
9864363
Compare
This eliminates thousands of lines of warnings from gcc on linux