Skip to content

Compiler warning on mismatching case/spelling #15848

Closed
@arnetheduck

Description

@arnetheduck

Nim allows identifiers that differ in cAse and sp_ell_ing - however, the spelling used in the declaration can be considered canonical.

For security-critical code, the introduction of alternate spellings can lead to vulnerabilities code injection (specially considering name clashes in larger project), and makes it harder to audit the code using tooling that is unaware of the naming, and generally creates confusion for developers reading the code.

As such, we would benefit from a compiler flag that, similar to --styleCheck, emits a warning when an alternate spelling is used, along with an option to disable it per-module, per-symbol or per-use (via pragmas?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions