Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserved identifiers used as local variables #4630

Closed
gilles-peskine-arm opened this issue Jun 8, 2021 · 0 comments · Fixed by #4750, #4778 or #4779
Closed

Reserved identifiers used as local variables #4630

gilles-peskine-arm opened this issue Jun 8, 2021 · 0 comments · Fixed by #4750, #4778 or #4779
Assignees
Labels
bug component-crypto Crypto primitives and low-level interfaces good-first-issue Good for newcomers size-s Estimated task size: small (~2d)

Comments

@gilles-peskine-arm
Copy link
Contributor

Identifiers starting with underscore and a capital letter, or with two underscore, are reserved everywhere in the C language. (Identifiers starting with an underscore and a lowercase letter are only reserved at file scope.) The library uses some reserved identifiers.

Here's a search that weeds out most positives:

grep -P '^(?!#| \*| *!?\(? *defined\(| *(__asm|__attribute__|__GNUC__)).*\b(?!__FILE__|__LINE__)_[A-Z_]' library/*.c tests/suites/*.function programs/*/*.c

The true positives are all in bignum.c: _B variable in several mbedtls_mpi_xxx_int functions and _RR argument in mbedtls_mpi_exp_mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment