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

erlc warnings are sent to stdout instead of to stderr #9255

Closed
eksperimental opened this issue Jan 1, 2025 · 0 comments · Fixed by #9363
Closed

erlc warnings are sent to stdout instead of to stderr #9255

eksperimental opened this issue Jan 1, 2025 · 0 comments · Fixed by #9363
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@eksperimental
Copy link
Contributor

Describe the bug
erlc warnings are sent to stdout instead of to stderr.

To Reproduce

$ cat src/has_warning.erl
-module(has_warning).
my_fn() -> ok.
$ erlc "src/has_warning.erl" > stdout.txt 2> stderr.txt
$ cat stderr.txt
$ cat stdout.txt
src/has_warning.erl:2:1: Warning: function my_fn/0 is unused
%    2| my_fn() -> ok.
%     | ^

Expected behavior
To have warnings sent to stderr.

Affected versions
OTP 27 and previous ones.

@eksperimental eksperimental added the bug Issue is reported as a bug label Jan 1, 2025
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jan 3, 2025
bjorng added a commit to bjorng/otp that referenced this issue Jan 30, 2025
`erlc` used to send all output to stdout, in contrast to other
language compilers such as `gcc` and `clang`, which send diagnostics
to stderr.

Fixes erlang#9255
bjorng added a commit to bjorng/otp that referenced this issue Jan 30, 2025
…aster/primary_preloaded

* bjorn/erlc-output/erlangGH-9255/OTP-19460:
  erlc: Send warnings and errors to stderr
@bjorng bjorng closed this as completed in 4856a63 Jan 31, 2025
bjorng added a commit that referenced this issue Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants