`A2-10-1`: False positive around null identifiers on tuple-like types in structural binding (relevant C++17 only)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Comece pela descoberta em openpilot's dmonitoring.cc:82:10 e inspecione IdentifierHiding.ql para ver como bindings semelhantes a tuplas sem nome são identificados. Em seguida, revise o stub tuple.h e compile o exemplo fornecido de structured bindings. Está concluído quando o exemplo compilar com elementos de tupla e bindings sucessivos não causarem mais um falso positivo.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Affected rules
- A2-10-1
- RULE-5-3
- M0-1-3
Description
the extractor creates local variables for each identifier, and one for the entire binding. The later is of type tuple without a name, so it gets (null) .
This means if you have another structured binding later on, the rule is falsely triggered because the name is the same.
Example
#include <tuple>
void f9(int x, int y){
auto tup = std::make_tuple(1, 2);
const auto & [ a, b ] = tup;
const auto & [ c, d ] = tup;
}
this example will require additional stubbing to be added to the tuple.h stub, as it currently will not compile due to tuples in that stub not currently having elements. Compilation error message: error: type 'const std::tuple<int, int>' decomposes into 0 elements, but 2 names were provided (ie needs to have mechanism to have elements and get those elements)
another example is the current finding in openpilot- dmonitoring.cc:82:10 from query IdentifierHiding.ql
- Linguagem predominante
- CodeQL
- Estrelas
- 227
- Forks
- 82
- Merge médio
- 6d 7h
- PRs com merge (30d)
- 9
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Abertafalse positive/false negative
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 65/100
github/codeql-coding-standards#1175 ·
Todas as issues de github/codeql-coding-standards
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
ScoopInstaller/Nonportable#639 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ScoopInstaller/Extras#18800 ·
-
Actualizar al último Wollok Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
uqbar-project/website-wollok-ts#84 · 2 comentários ·
-
on hold T: core-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100