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
The NF should catch uninitialized variables in functions #9717
Comments
#9761 adds a check for using uninitialized values in functions, it's not perfect but should be approximately the same as in the OF. #9763 additionally adds a check for uninitialized outputs since the algorithm returns those anyway. It's a bit inconsistent because the first is just a warning while the second is an error, because that's how they were already defined. Perhaps both should be an error. The specification does say that using an uninitialized variable is an error anyway, and the algorithm is very conservative and shouldn't have any false positives. |
If you are sure that false positives are unlikely, I would make it an error. But we have to be 100% certain about that. |
It seems we do get one false positive in the library testing, one of the ThermoPower models guards a function from being called with an if-expression. So if we want to allow such functions as long as they're not actually called I guess we need to change it to be a warning instead. |
The old frontend was able to catch uninitialized variables in functions. For example, compiling this MWE with the OF
gave the following warnings:
This should be ported to the NF as well.
The text was updated successfully, but these errors were encountered: