otp icon indicating copy to clipboard operation
otp copied to clipboard

A compiler (warning?) message could be clearer

Open michaelklishin opened this issue 1 year ago • 1 comments

When gen_batch_server is compiled with erlc from Erlang/OTP 26.2.x, the compiler emits the following:

gen_batch_server.erl:269: Warning: INFO: receive matches any message, this is always fast
gen_batch_server.erl:323: Warning: INFO: receive matches any message, this is always fast

I find this message to not be particularly helpful. Two specific complaints:

  1. Is this a warning? is this an info message? It says both
  2. This is likely meant to be a warning but it says "this is always fast" which is usually something to strive for

So what is this message trying to tell me? With the current wording I have to guess.

michaelklishin avatar Jun 20 '24 02:06 michaelklishin

Thanks for your report!

The messages printed by bin_opt_info and recv_opt_info are returned as warnings to keep things simpler internally. The compiler currently lacks a mechanism for purely informational messages, and we're thinking of adding one in the future -- it's just fairly low priority at the moment.

In the meantime, whenever you see Warning: INFO:, read it as INFO:. :-)

jhogberg avatar Jun 20 '24 07:06 jhogberg