-
Notifications
You must be signed in to change notification settings - Fork 203
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
Suppress format-truncation warnings #1097
Comments
@skliper Is it a reasonable approach if I added cFE/cmake/sample_defs/arch_build_custom.cmake Lines 28 to 37 in a6c6b65
This location make sense to me since |
I can confirm that (because I'm using Ubuntu 21.10 which has GCC 11) that I have added these option to my local I recommend adding both of these options, as they produce similar nuisance warnings:
One affects printf-style formatting, the other affects other string ops. |
Main thing is to check/confirm that this option is benign to older GCC versions. I think we are still targeting/supporting CentOS7 which has gcc 4.8 (ancient history). So it would be wise to make sure this old compiler doesn't complain about that option. |
We should consider how many compilers we want to support and maybe draw a line just like we do with OSs and custom |
Fix #1097, adds truncation warning suppression flags
Fix #1097, adds truncation warning suppression flags
Is your feature request related to a problem? Please describe.
It's only triggered when length limited *printf functions are used, and that's why we use them in the cFS context (to truncate as needed).
Describe the solution you'd like
Add
-Wno-format-truncation
to default flags, users can customize the flags as needed if they want to see these warnings.Describe alternatives you've considered
Up to this point we've been implementing ways to suppress the individual warnings, but that just adds complexity where the point is to truncate when needed.
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: