Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Function parameters in blocks are visible as "global" variables #180

Open
Windwoes opened this issue Dec 26, 2019 · 0 comments
Open

Function parameters in blocks are visible as "global" variables #180

Windwoes opened this issue Dec 26, 2019 · 0 comments

Comments

@Windwoes
Copy link
Member

As I was helping our sister team that uses Blocks, I noticed that function parameters are listed as "global" variables, i.e. lumped into the same menu as "normal" variables.

This is extremely confusing and makes absolutely no sense at all. At a minimum, parameter variables should not "click" into place in functions other than their parents. However, having them be a different color and accessible through the little gear icon on the function (rather than through the variables pane) would also be a good idea.

Additionally, I feel like there's a possibility for undefined behavior here, because (as mentioned before) you can click a parameter block for funcationA into some code functionB. I would have no idea what the value of this variable would be when used outside its parent function. In C, returning a pointer to a local variable will cause undefined behavior because that method's stack will have been freed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant