Skip to content

Conversation

@jimmale
Copy link

@jimmale jimmale commented Jan 29, 2026

The initial motivation for this PR was to resolve compiler warnings, which are promoted to errors, which cause the build to fail. I ended up also fixing a couple issues with some of the tests (other issues still remain).

  • (gcc) Strings in ais_charset.c, interactive.c, and uat_decode.c had character arrays initialized without a null terminator. GCC's proposed fix is not portable to clang, so I've removed the hard-coded array length. Both compilers seem to be satisfied with this. (See also, Fix: Increase spinner array size for GCC 14/15 compatibility #10)
  • (clang) The value of res in geomag.c was not being used. I've added appropriate checks to use the value as intended.
  • (clang) Certain variables in globe_index.c were being written, but never read. I've removed the lines of code in question.
  • The CRC tests were failing due to the setExit symbol being missing, so I've added a stubbed version for the tests.
  • Small changes to the Makefile for ergonomics

Tested on the following setup:

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=25.10
DISTRIB_CODENAME=questing
DISTRIB_DESCRIPTION="Ubuntu 25.10"

$ gcc --version
gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang --version
Ubuntu clang version 20.1.8 (0ubuntu4)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-20/bin

Full disclosures:

  • C is not my strongest language
  • This PR does not contain AI-generated code

Hard-coding the length of these strings causes build errors (warnings)
on modern gcc/clang. Letting the compiler count the characters works
just as well.
@jimmale jimmale changed the title Resolve build errors Fix: resolve build errors Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant