Skip to content

Fix unterminated-string-initialization warnings - #1472

Merged
flyingmutant merged 1 commit into
cmus:masterfrom
chggr:fix-initializer-string-warnings
Dec 11, 2025
Merged

flyingmutant merged 1 commit into
cmus:masterfrom
chggr:fix-initializer-string-warnings

Conversation

@chggr

@chggr chggr commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

When compiling cmus I get multiple warnings around unterminated string initialization. This patch fixes the warnings by replacing the string initializers with explicit char initializers to avoid truncation of null terminator.

@pgaskin

pgaskin commented Dec 5, 2025

Copy link
Copy Markdown
Member

What are you compiling it with?

@pgaskin
pgaskin self-requested a review December 5, 2025 04:11
@chggr

chggr commented Dec 5, 2025

Copy link
Copy Markdown
Contributor Author

What are you compiling it with?

gcc (GCC) 15.2.1 20251111

@flyingmutant

Copy link
Copy Markdown
Member

TBH I don't like the change, as the code becomes much less readable. I think either disabling the warning or using nonstring attribute is a better fix (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178).

When compiling cmus I get multiple warnings around unterminated string
initialization. This patch fixes the warnings by using the nonstring
attribute.
@chggr
chggr force-pushed the fix-initializer-string-warnings branch from 4022f63 to ab7979f Compare December 10, 2025 21:08
@chggr

chggr commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I have updated the commit as requested.

@flyingmutant
flyingmutant merged commit d3a7f1f into cmus:master Dec 11, 2025
@chggr
chggr deleted the fix-initializer-string-warnings branch December 11, 2025 21:44
@BrewTestBot BrewTestBot mentioned this pull request Oct 28, 2026
1 task done
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.

3 participants