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

Print warnings in lfc even if there are errors #1859

Closed
lhstrh opened this issue Jun 20, 2023 · 4 comments · Fixed by #2008
Closed

Print warnings in lfc even if there are errors #1859

lhstrh opened this issue Jun 20, 2023 · 4 comments · Fixed by #2008
Labels
cli good first issue Good for newcomers
Milestone

Comments

@lhstrh
Copy link
Member

lhstrh commented Jun 20, 2023

The message printed when there exists ambiguity in the program (see #1853) could arguably be an warning instead of an error, but it turns out warnings are not shown by lfc. We should fix this.

@cmnrd
Copy link
Collaborator

cmnrd commented Jun 20, 2023

Do you have an example where warnings are not reported by lfc? It works fine for me on master. For instance

target Cpp {
  keepalive: true
}

main reactor Minimal {
  reaction(startup) {= std::cout << "Hello World!\n"; =}
}

produces

--> test/Cpp/src/Minimal.lf:3:3
  |
2 | target Cpp {
3 |   keepalive: true
  |   ^^^^^^^^^ The keepalive property is inferred automatically by the C++ runtime and the value given here is ignored
  |
4 | }

@lhstrh
Copy link
Member Author

lhstrh commented Jun 20, 2023

When I turned the error in #1853 into warning, it didn't show up...

@cmnrd
Copy link
Collaborator

cmnrd commented Jun 21, 2023

I just tried this out and indeed the warning wasn't shown for me either on first try. This is because you will get a linker error if you make a reaction bodyless for testing, but don't provide the implementation. The issue reporter in lfc collects all issues during the run, but it does not print the issues immediately (so that they are not intermingled with the cmake output). In this case, the issue reporter will collect two issues: the warning message and the linker error. Currently, lfc does not print warnings if there are errors. Hence, the warning is not printed, only the linker error. If you run lfc with --no-compile it will print the warning message as no compilation error occurs.

So, the question for this issue is: do we want to keep the current behavior or should we always print warnings.

@lhstrh
Copy link
Member Author

lhstrh commented Jun 22, 2023

So, the question for this issue is: do we want to keep the current behavior or should we always print warnings.

I think that (in hindsight), we should always print warnings.

@cmnrd cmnrd added the cli label Jun 23, 2023
@cmnrd cmnrd changed the title Warning messages are suppressed by lfc Print warnings in lfc even if there are errors Jun 23, 2023
@cmnrd cmnrd added the good first issue Good for newcomers label Jun 23, 2023
@cmnrd cmnrd modified the milestones: 0.6.0, 0.5.0 Jun 23, 2023
@lhstrh lhstrh modified the milestones: 0.5.0, 0.6.0 Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants