Fix build failures with GCC: increase char array sizes (interactive.c, ais_charset.c/.h) #278
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes two build-breaking issues introduced by newer GCC versions when building dump1090-fa from source.
GCC now treats several warnings as errors (due to -Werror), which causes dump1090-fa to fail compilation because two string initializers do not fit into their declared char arrays. As a result, several AUR users and downstream packagers cannot currently build this project.
What this PR fixes
1. interactive.c
char spinner[4] = "|/-";
Copy code
The initializer string is 5 bytes long (4 chars + '\0') but the array has size 4.
→ Replaced with:
char spinner[] = "|/-";
Copy code
2. ais_charset.c / ais_charset.h
char ais_charset[64] = "@abcdefghijklmnopqrstuvwxyz[]^_ !"#$%&'()*+,-./0123456789:;<=>?";
Copy code
The initializer string contains 65 characters plus the NUL terminator but the array allows only 64.
The header also declares:
extern char ais_charset[64];
Copy code
→ Both updated to:
char ais_charset[] = "...";
extern char ais_charset[];
Copy code
✔️ Result
• All build failures are resolved
• GCC no longer raises unterminated-string-initialization errors
• No functional behavior changes
• No changes required in other parts of the code
• Compatible with all current GCC versions
Why this matters
Dump1090-fa currently fails to build on modern Linux distros (Arch, Debian testing, etc.) due to these strict Werror failures. This PR ensures the project continues to compile cleanly.
Let me know if you want me to squash commits or adjust the patch.