Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`DCL51-CPP`: Only reserve function names when used within the global namespace

Abierto
#148 5 comentarios 0 reacciones 1 asignado Ver en GitHub

@lcartey ya está trabajando en esto.

Desde el 14/1/2024.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Difficulty-High false positive/false negative Impact-High Stardard-CERT-C++ user-report
Affected rules
  • DCL51-CPP
Description

The rule currently enforces that function names defined in standard library headers are not reused in any namespace. However, a careful re-reading of the C++ standard suggests that's overly specific. [reserved.names] specifically states that the only kinds of name that are reserved are macros, "global names" and "names with external linkage". In [extern.names], the standard says:

Each global function signature declared with external linkage in a header is reserved to the implementation to designate that function signature with external linkage.

So only global function signatures are reserved, and only where they have external linkage. I think we need to do the following:

  • Apply only to the global namespace
  • Filter list of reserved function names by those that appear in the global namespace and have external linkage (this may already be the case).
  • Match function signatures (I believe it is valid to reuse the name as long as the signature is different).

We may also need to review the rules for objects and _ prefixes.

Example
namespace MyNamespace {
  void all_of(); // COMPLIANT
}
Lenguaje dominante
CodeQL
Estrellas
227
Forks
82
Merge medio
6 d 7 h
PR fusionados (30 d)
9

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/codeql-coding-standards

Todos los issues de github/codeql-coding-standards

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.