Skip to content

Ignore strFl altitude modeC truncation for -Werror - #321

Merged
mutability merged 1 commit into
flightaware:masterfrom
ryand56:push-yyzospwplrvu
Oct 12, 2026
Merged

mutability merged 1 commit into
flightaware:masterfrom
ryand56:push-yyzospwplrvu

Conversation

@ryand56

@ryand56 ryand56 commented Oct 4, 2026 •

Copy link
Copy Markdown

Fails to build on newer GCC due to truncation warning/errors (due to -Werror).

interactive.c: In function 'interactiveShowData':
interactive.c:334:49: error: '%5d' directive output may be truncated writing between 5 and 11 bytes into a region of size 7 [-Werror=format-truncation=]
  334 |                 snprintf(strFl, sizeof(strFl), "%5d ", convert_altitude(modeC * 100));
      |                                                 ^~~

@ryand56 ryand56 mentioned this pull request Oct 4, 2026
3 of 13 tasks
@mutability

Copy link
Copy Markdown

I think this needs a smarter fix than just blindly following the compiler warning here, the warning (-> error because -Werror) is a false positive.

(either working out a simple way to suppress the warning at that particular point of use - is a (void) case sufficient to tell the compiler we really don't care about truncation? - or disabling the warning category entirely)

@ryand56 ryand56 changed the title Increase buffer size for altitude text Ignore strFl altitude modeC truncation for -Werror Oct 12, 2026
@ryand56

ryand56 commented Oct 12, 2026 •

Copy link
Copy Markdown
Author

Right, I had -Werror passed to the build. (void) did nothing here so I ignored the warning for just this line.

@mutability

Copy link
Copy Markdown

I don't love it but that works for now. thanks!

@mutability
mutability merged commit ebc6185 into flightaware:master Oct 12, 2026
8 checks passed
@mutability

Copy link
Copy Markdown

Ugh, sorry, messed up that merge. Let me apply by hand.

@ryand56
ryand56 deleted the push-yyzospwplrvu branch October 13, 2026 01:07
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.

2 participants