`A15-4-4`: Query incorrectly alerts functions that raise/can raise exceptions
@rak3-sh y travaille déjà.
Depuis le 22/12/2024.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Affected rules
A15-4-4
Description
- Query doesn’t consider ReThrowExpr. E.g. the query says to mark
rethrow()below asnoexcept
Example
template <bool DoRethrow>
void rethrow() {
throw;
}
int main()
{
rethrow<true>();
return 0;
}
- The query doesn’t check for throw expressions that occur inside lambdas defined in a function. E.g.
Example
void func() {
std::call_once(init_flag_, [this] {
if (sem_init(&sem_, 0, 0) != 0) {
throw std::system_error(errno, std::system_category()); // Throw in a lambda.
}
initialized_ = true;
});
}
- In some cases the noexcept specification is a complex condition involving several logical operations or template instantiations. In such a case, CodeQL’s check for whether its noexcept(true) or noexcept explicitly false doesn’t work and it alerts that it can be marked as noexcept. For practical reasons, maybe we can consider a noexcept(expr) as being marked by the user as correct.
- Langage dominant
- CodeQL
- Étoiles
- 227
- Forks
- 82
- Merge moyen
- 6 j 7 h
- PR mergées (30 j)
- 9
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Ouvertefalse positive/false negative
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Difficulté 3/5 1-2 jours Accessibilité débutants 65/100
github/codeql-coding-standards#1175 ·