gcc14 patch for ROX-Filer
ROX-Filer is compiled in woofQ2 and a PET created, that is used
in the EasyOS build. You can download the woofQ2 tarball to see
the source: it is old source dated 2011-10-22, with 22 patches.
It compiles ok in EasyOS, with gcc 14, with a lot of warnings, so I thought why not ask Claude AI? Blog post yesterday, reported on using Claude for the first time, converted some BaCon and nim coded utilities to C. Was very impressed with Claude -- and a bit worried how clever it is.
Decided why not ask Claude if can create a patch so ROX-Filer will compile cleanly with gcc14. Using the free Claude, uploaded rox source tarball, with the 22 patches already applied, and asked this:
Please create a patch so this code will compile cleanly with gcc 14 in linux
This is the reply:
This is ROX-Filer (GTK2). The sandbox has gcc 13 and no GTK2
headers, so I can’t do a full gcc 14 build. I’m statically
checking for the constructs gcc 14 turns into errors (implicit
declarations, int/pointer conversions) and fixing the configure
GCC-version check.
Still auditing: no GTK2/libxml headers here, so I’m checking the
likely gcc 14 error spots by hand (pointer-type mismatches on
gsize/len arguments, missing includes) and I’ve already found
the configure.in/configure GCC-version bug. Patch comes next.
I’ve made a patch (rox-filer-gcc14.patch), but I couldn’t
compile it. This sandbox has gcc 13 only, with no GTK2 or libxml
headers and no network to fetch them. It applies cleanly to your
tarball, and configure still passes a shell syntax check. Please
do a real build on your gcc 14 system to confirm.
I found one definite gcc 14 problem:
configure.in and configure: the GCC version check only matched
single-digit major versions ([5-9]). On gcc 10 and up, including
14, it fell through to the default branch. That branch skipped
-Wno-pointer-sign and -fno-stack-protector, so the build gets a
flood of pointer-sign warnings. The patch changes the pattern to
[5-9]|[1-9][0-9]. It edits both files because the generated
configure is in the tarball, so you don’t need to re-run
autoconf.
I also added includes that were missing as far as I could tell
by grep. Each one was reached only through other headers, so gcc
14’s stricter implicit-declaration errors could bite if those
paths change:
dir.c: <fcntl.h> for open/fcntl.
minibuffer.c and support.c: <strings.h> for strncasecmp.
xdgmimemagic.c: <wchar.h> for mbrtowc.
action.c: <sys/select.h> for select.
I also looked at hash-table and qsort callback signatures and
the int/pointer conversions I could find by grep, and found no
mismatches. If your gcc 14 build still stops with an error, send
me the compiler output and I’ll extend the patch.
filer.c.orig in the tarball differs from filer.c. I left it
alone, so it still sits in the source tree.
And Claude created 'rox-filer-gcc14.patch', that I added to
woofQ2, compiled rox; there was just one deprecated warning. Very
impresssed.
Tags: easy