Bug 281225

Summary: deskutils/sliderule: Fails to build with GCC 14: error: initialization of 'Pixmap' {aka 'long unsigned int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
Product: Ports & Packages Reporter: Lorenzo Salvadore <salvadore>
Component: Individual Port(s)Assignee: Joerg Wunsch <joerg>
Status: Closed FIXED    
Severity: Affects Only Me CC: danfe
Priority: --- Flags: bugzilla: maintainer-feedback? (joerg)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/sliderule-1.0_11.log
Bug Depends on:    
Bug Blocks: 281091    

Description Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-03 12:45:59 UTC
Build fails with GCC 14. This blocks GCC_DEFAULT update to GCC 14.

=======================<phase: build          >============================
===== env: NO_DEPENDS=yes USER=root UID=0 GID=0
===>  Building for sliderule-1.0_11
gcc14  -O2 -pipe  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc14 -fno-strict-aliasing        -I/usr/local/include    -DCSRG_BASED  -DFUNCPROTO=15 -DNARROWPROTO   -DSLIDERULE  -c sr.c -o sr.o
sr.c:7:9: warning: extra tokens at end of #endif directive [-Wendif-labels]
    7 | #endif  lint
      |         ^~~~
sr.c:56:20: error: initialization of 'Pixmap' {aka 'long unsigned int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   56 | Pixmap  slidePix = NULL;
      |                    ^~~~

Stop.
make: stopped in /usr/ports/audio/funktrackergold

Full log: https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/sliderule-1.0_11.log

Useful link: https://gcc.gnu.org/gcc-14/porting_to.html
Comment 1 Alexey Dokuchaev freebsd_committer freebsd_triage 2024-10-18 15:46:03 UTC
It's an old software, so there're lots of warnings.  They are not hard to fix or mute, but it really looks like USE_GCC is actually not needed here.
Comment 2 Joerg Wunsch freebsd_committer freebsd_triage 2024-10-21 21:25:09 UTC
Correct, it doesn't really require GCC.

Fixing all the warnings and (nowadays) errors of that old code takes more time than I anticipated. I really wonder whether we might want a "GCC traditional" port, i.e. one that could still compile pre-C89 code without complaining, just to be able to compile prehistoric code. GCC dropped the actual -traditional support some years ago (except for preprocessing). Code like this one does not right away deserve the attribute "broken", yet it has been written the way it used to be some 40 years ago.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-10-22 22:04:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4050539eaaaa6fc986a76656df7b78029f0388c7

commit 4050539eaaaa6fc986a76656df7b78029f0388c7
Author:     Joerg Wunsch <joerg@FreeBSD.org>
AuthorDate: 2024-10-22 22:00:53 +0000
Commit:     Joerg Wunsch <joerg@FreeBSD.org>
CommitDate: 2024-10-22 22:03:20 +0000

    deskutils/sliderule: prepare for 3rd millenium

    This historic (pre-C89) code no longer compiled under modern
    compilers. Modernize it.

    The code does not rely on GCC-specific stuff, so remove this
    requirement.

    PR:             281225

 deskutils/sliderule/Makefile                    |   1 -
 deskutils/sliderule/files/patch-sr.c (new)      | 293 +++++++++++
 deskutils/sliderule/files/patch-xcalc-2.c (new) | 613 ++++++++++++++++++++++++
 3 files changed, 906 insertions(+), 1 deletion(-)
Comment 4 Joerg Wunsch freebsd_committer freebsd_triage 2024-10-22 22:04:27 UTC
Fixed in 4050539eaaaa6f