`RULE-11-9`: Consider more types of assignment
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Non sono indicati file di implementazione o test. Inizia individuando la query RULE-11-9 e tracciando come viene rappresentata l’assegnazione, quindi confrontala con le quattro operazioni di assegnazione elencate nell’issue. Il lavoro è completato quando la copertura di tali operazioni da parte della regola è definita e convalidata, incluse eventuali regole interessate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
}
- Lingua principale
- CodeQL
- Stelle
- 227
- Fork
- 82
- Merge medio
- 6g 7h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Apertafalse positive/false negative
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
github/codeql-coding-standards#1175 ·
Tutte le issue di github/codeql-coding-standards
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
duckdb/duckdb-python#627 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
objectionary/hone-maven-plugin#1078 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
nearform/ag-grid-url-sync#160 ·