`RULE-11-9`: Consider more types of assignment
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 38/100
Rechercherichtung
Es werden keine Implementierungsdateien oder Tests genannt. Beginne damit, die Abfrage RULE-11-9 zu finden und nachzuverfolgen, wie die Zuweisung dargestellt wird, und vergleiche sie anschließend mit den vier im Issue aufgeführten Zuweisungsoperationen. Die Arbeit ist abgeschlossen, wenn die Abdeckung dieser Operationen durch die Regel definiert und validiert ist, einschließlich aller betroffenen Regeln.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Affected rules
RULE-11-9
Description
Rule 11.9 prohibits the use of 0 as a null pointer constant when assigning to a pointer. However, we do not capture all the types of assignments. The Glossary (Appendix J) states:
Assigned
An expression is assigned if it is the subject of an assignment.
Assignment
It is sometimes convenient to use the term assignment to denote any operation which takes place as if it were by assignment. The operations covered by this term are:
• Assignment by means of one of the assignment operators;
• Passing an argument to a function, in which case the argument is copied as if by assignment to the corresponding parameter;
• Returning an expression from a function, in which case the result is copied as if by assignment to an object with the function’s return type;
• Using an expression to initialize all or part of an object, including a compound literal in C99, in which case the expression is copied as if by assignment to the destination.
This may also impact other MISRA rules that refer to the term assignment or assigned.
Example
void* myfunc() {
return 0; // NON_COMPLIANT
}
- Vorherrschende Sprache
- CodeQL
- Sterne
- 227
- Forks
- 82
- Ø Merge
- 6 T. 7 Std.
- Gemergte PRs (30 T.)
- 9
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Offenfalse positive/false negative
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
github/codeql-coding-standards#1175 ·
Alle Issues in github/codeql-coding-standards
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
use-agent-os/agent-os#3314 ·
-
[aw] Upgrade available Offenagentic-workflows
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
githubnext/rig#534 ·
-
documentation low-priority templates
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
jesseray718/openroot#87 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
ReedClanton/NixOS#41 ·