Add C compiler base options guidelines#63
Open
josecm wants to merge 3 commits into
Open
Conversation
Signed-off-by: Jose Martins <josemartins90@gmail.com>
Signed-off-by: Jose Martins <josemartins90@gmail.com>
Signed-off-by: Jose Martins <josemartins90@gmail.com>
6709d42 to
ec00050
Compare
Member
Author
danielRep
requested changes
Jul 27, 2023
Comment on lines
+33
to
+49
| - The C11 version shall be used. | ||
|
|
||
| Compiler options: `-std=c11`. | ||
| MISRA C:2012 : R1.1 | ||
|
|
||
| - No language extensions shall be allowed. | ||
|
|
||
| Compiler options: `-pedantic -pedantic-errors`. | ||
| MISRA C:2012 : R1.1 | ||
|
|
||
| - Treat all warnings as errors so no warnings can be ignored. | ||
|
|
||
| Compiler options: `-Werrors`. | ||
|
|
||
| - Enable all recommended warnings. | ||
|
|
||
| Compiler options: `-Wall -Wextra`. |
Member
There was a problem hiding this comment.
Suggested change
| - The C11 version shall be used. | |
| Compiler options: `-std=c11`. | |
| MISRA C:2012 : R1.1 | |
| - No language extensions shall be allowed. | |
| Compiler options: `-pedantic -pedantic-errors`. | |
| MISRA C:2012 : R1.1 | |
| - Treat all warnings as errors so no warnings can be ignored. | |
| Compiler options: `-Werrors`. | |
| - Enable all recommended warnings. | |
| Compiler options: `-Wall -Wextra`. | |
| R1. **The C11 version shall be used.** | |
| - Compiler options: `-std=c11`. MISRA C:2012 : R1.1 | |
| R2. **No language extensions shall be allowed.** | |
| - Compiler options: `-pedantic -pedantic-errors`. MISRA C:2012 : R1.1 | |
| R3. **Treat all warnings as errors so no warnings can be ignored.** | |
| - Compiler options: `-Werrors`. | |
| R4. **Enable all recommended warnings.** | |
| - Compiler options: `-Wall -Wextra`. |
Member
DavidMCerdeira
requested changes
Sep 4, 2024
Comment on lines
+23
to
+24
| both. If one compiler is supported for given project, it must be so for all | ||
| supported target architectures. |
Member
There was a problem hiding this comment.
Might be too strict, for example for tricore
| both. If one compiler is supported for given project, it must be so for all | ||
| supported target architectures. | ||
|
|
||
| For reach guideline we try to provide a set of compiler options which enforce |
Member
There was a problem hiding this comment.
Suggested change
| For reach guideline we try to provide a set of compiler options which enforce | |
| For each guideline we try to provide a set of compiler options which enforce |
Comment on lines
+33
to
+49
| - The C11 version shall be used. | ||
|
|
||
| Compiler options: `-std=c11`. | ||
| MISRA C:2012 : R1.1 | ||
|
|
||
| - No language extensions shall be allowed. | ||
|
|
||
| Compiler options: `-pedantic -pedantic-errors`. | ||
| MISRA C:2012 : R1.1 | ||
|
|
||
| - Treat all warnings as errors so no warnings can be ignored. | ||
|
|
||
| Compiler options: `-Werrors`. | ||
|
|
||
| - Enable all recommended warnings. | ||
|
|
||
| Compiler options: `-Wall -Wextra`. |
This file contains hidden or 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
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 a set of guidelines on what options to use in the C compiler to be compliant with standard C11 and enable the base recommended warnings that will enforce a lot of the C guidelines that will be proposed next.
I'm wondering if this is the best way to indicate the compiler options, misra rules and checkers for each rule. Both structurally and formatting-wise. Please provide some feedback.
This PR is dependent on #62.
Checklist: