Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hoist field width initialization to avoid LTO warning #278

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

charlesnicholson
Copy link
Owner

@charlesnicholson charlesnicholson commented Jan 26, 2025

The field_width member of the format spec structure was only being initialized in a code path where it was known to be used in the future. This confuses GCC's always-flaky maybe-uninitialized warning logic, which is disabled in nanoprintf.h but seems to persist due to a GCC bug where LTO ignores warning flags.

So, this PR just moves field_width initialization to the common path.

@charlesnicholson charlesnicholson merged commit 5b1255d into main Jan 27, 2025
22 checks passed
@charlesnicholson charlesnicholson deleted the initialize-field-width branch January 27, 2025 01:52
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