-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Replace reserved identifier clashes with suitable replacements #4750
Replace reserved identifier clashes with suitable replacements #4750
Conversation
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename _RR
in bignum.h
.
I think this warrants a changelog entry under Bugfix, since our code had undefined behavior. Something like
Don't use reserved identifiers as local variables. Fixes #4630.
Other than that, looks good to me.
The CI complaint is a warning that a renamed parameter could indicate a semantic change. Since we know the parameter didn't change semantics, this is a false positive.
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
71110d9
to
538a0cb
Compare
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Description
Closes #4630. C unconditionally reserves identifiers that either begin with two underscore, or a single underscore followed by a capital letter. MbedTLS has a few of these, and they could cause unwanted effects if the compilers decide to use these identifiers.
A slightly modified version of the grep in the issue was used to find all matches.
_B
was replaced withB
since it was safe to do so._RR
(representing the precomputed value of R squared) was replaced withprec_RR
sinceRR
is defined in the same scope. The header file (bignum.h) was also edited to reflect this change.Open to other names, since I'm not very proud of
prec_RR
but I can't think of anything better other than the explicit and longprecomputed_RR
.Status
READY
Requires Backporting
Yes, because it is a bugfix.
Requires ChangeLog entry
Yes, as a bugfix.