-
Notifications
You must be signed in to change notification settings - Fork 131
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
feat(c11): Add additional warning flags #147
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
miguelafsilva5
requested review from
josecm,
ninolomata,
AfonsoSantos96,
DavidMCerdeira,
sandro2pinto and
danielRep
as code owners
May 17, 2024 15:21
@miguelafsilva5 note that one of the checks is failing |
miguelafsilva5
force-pushed
the
feat/extra_flag
branch
from
May 22, 2024 12:56
6900b8a
to
7b023b1
Compare
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
4 times, most recently
from
May 22, 2024 13:31
b8c156a
to
a9b25fc
Compare
miguelafsilva5
force-pushed
the
feat/extra_flag
branch
from
May 22, 2024 13:43
7b023b1
to
62f2efe
Compare
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 22, 2024 13:46
a9b25fc
to
535347c
Compare
The code was not formatted properly. It is fixed in the recent commits. |
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 22, 2024 13:59
535347c
to
6ea3093
Compare
miguelafsilva5
force-pushed
the
feat/extra_flag
branch
3 times, most recently
from
May 22, 2024 14:25
a097b1b
to
75858f3
Compare
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 22, 2024 14:32
6ea3093
to
e1c6a76
Compare
miguelafsilva5
force-pushed
the
feat/extra_flag
branch
from
May 22, 2024 14:41
75858f3
to
2f72d8c
Compare
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 22, 2024 14:45
e1c6a76
to
fb1daef
Compare
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 23, 2024 11:21
fb1daef
to
04774f2
Compare
This commit adds warning flags that are not included in -wall and -wextra. These flags will help dealing with some MISRA directives (e.g., forcing explicit casts, adding missing prototypes, etc.) Signed-off-by: Miguel Silva <[email protected]>
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 23, 2024 12:43
04774f2
to
d2ebc8a
Compare
josecm
requested changes
May 23, 2024
@miguelafsilva5 this is not compiling for the fvp-a-aarch32 platform. |
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 23, 2024 13:50
d2ebc8a
to
28d90fb
Compare
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 23, 2024 13:58
28d90fb
to
9cdbbcb
Compare
With the additional compiler flags, most implicit casts are not allowed. This commit achieves this by forcing explicit casts, refactoring some variable types and fixing literal values. Signed-off-by: Miguel Silva <[email protected]>
The missing prototype error was being triggered due to one of the following: - the prototype was effectively missing; - the prototype was ill defined (mainly, no paramter function prototypes missed 'void' as paramter list; - the function did not have a prototype but did not require it. Mostly, because it was only used in the compilation unit - in this case to avoid, the error it must be defined as static; In some other cases these functions had a prototype defined which was not necessary and was thus removed. Signed-off-by: Miguel Silva <[email protected]>
Switch statements without a default case cause errors with the -Wswitch-default flag. Signed-off-by: Miguel Silva <[email protected]>
The flag -Wcast-qual issues errors when a qualifier (e.g., const) is removed through a cast. Signed-off-by: Miguel Silva <[email protected]>
Signed-off-by: Miguel Silva <[email protected]>
The Wshadow flag warns whenever a local variable or type declaration shadows another variable (e.g., global variables) Signed-off-by: Miguel Silva <[email protected]>
Signed-off-by: Miguel Silva <[email protected]>
Signed-off-by: Miguel Silva <[email protected]>
The compiler issues errors when trying to get the reference of elements of packed structs since it might result in unaligned pointer values. As such we forced the elements in question to be aligned inside the struct. Signed-off-by: Miguel Silva <[email protected]>
miguelafsilva5
force-pushed
the
feat/stricter_error_flags
branch
from
May 23, 2024 14:02
9cdbbcb
to
2dff14e
Compare
josecm
approved these changes
May 23, 2024
DavidMCerdeira
approved these changes
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces several compiler flags that issue warnings from additional sources.
The goal of these flags is to help complying with some MISRA directives. The flags include: forcing explicit casts, adding missing protypes, removing unused macros and functions, etc.
This PR depends on #146
The code was tested in the following platforms: