-
Notifications
You must be signed in to change notification settings - Fork 284
Do not shadow the class member return_type [blocks: #2310] #3358
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
Conversation
peterschrammel
left a comment
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.
A few naming suggestions
src/ansi-c/c_typecheck_expr.cpp
Outdated
| code_function_callt &fc=to_code_function_call(last); | ||
|
|
||
| const auto &return_type = to_code_type(fc.function().type()).return_type(); | ||
| const auto &r = to_code_type(fc.function().type()).return_type(); |
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.
Suggestions: return_type_ref, call_return_type ?
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.
I have just removed the temporary instead.
src/ansi-c/c_typecheck_expr.cpp
Outdated
| // Let's just add it. | ||
| // We do a bit of return-type guessing, but just a bit. | ||
| typet return_type=signed_int_type(); | ||
| typet r = signed_int_type(); |
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.
guessed_return_type ?
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.
Done.
src/ansi-c/c_typecheck_type.cpp
Outdated
| // is a function type or an array type." | ||
|
|
||
| const typet &return_type=follow(type.return_type()); | ||
| const typet &r = follow(type.return_type()); |
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.
decl_return_type ?
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.
Thanks, done!
Removed the temporary where it added no value and otherwise renamed it to descriptive names.
028b786 to
b490078
Compare
allredj
left a comment
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 028b786).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90980987
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: b490078).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90981981
Using the very short variable name "r" to make clear this is only of very local
use instead.