Skip to content

Conversation

@zfogg
Copy link

@zfogg zfogg commented Jan 14, 2026

Summary

  • Adds __attribute__((nonstring)) to two character arrays that are intentionally sized without room for a null terminator
  • Fixes build failure with modern Clang when -Werror is enabled

Details

The ais_charset (64-char AIS lookup table) and spinner (4-char animation) arrays are used as raw byte lookup tables, not C strings. Clang's -Wunterminated-string-initialization warning (promoted to error by -Werror) causes the build to fail.

The nonstring attribute is the idiomatic fix—it documents intent and is more targeted than disabling the warning globally via compiler flags.

Test plan

  • Verified build succeeds with Clang 21

These character arrays are intentionally sized to exactly fit their
contents without a null terminator - they are used as lookup tables,
not C strings. Modern Clang fails to build with -Werror due to
-Wunterminated-string-initialization.

The nonstring attribute documents the intent and silences the error
without requiring global compiler flag changes.
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