Skip to content

Commit 3809143

Browse files
committed
make: Suppress Elixir charlist warning for dialyze target
The `:io.format/2` call was originally passed a single-quote string (i.e. a charlist in Elixir terminology) which emits a warning in more recent Elixir versions: warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead └─ nofile:1:12 This warning would pop up a few times when using `make dialyze` within a deps directory. To resolve it we can switch the quoting so that the eval string is wrapped in single quotes (equivalent for shell since this line doesn't use variables) and the format argument is wrapped in double quotes. This uses a binary in Elixir instead, but that's ok because `io:format/3`'s `io:format()` parameter may either be an atom, string, or binary. This trick was copied from Makefile:49 which uses the same quoting.
1 parent bdb8ff2 commit 3809143

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps/rabbit_common/mk/rabbitmq-early-plugin.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
DIALYZER_OPTS ?= -Werror_handling -Wunmatched_returns -Wunknown
66

7-
dialyze: ERL_LIBS = $(APPS_DIR):$(DEPS_DIR):$(DEPS_DIR)/rabbitmq_cli/_build/dev/lib:$(dir $(shell elixir --eval ":io.format '~s~n', [:code.lib_dir :elixir ]"))
7+
dialyze: ERL_LIBS = $(APPS_DIR):$(DEPS_DIR):$(DEPS_DIR)/rabbitmq_cli/_build/dev/lib:$(dir $(shell elixir --eval ':io.format "~s~n", [:code.lib_dir :elixir ]'))
88

99
# --------------------------------------------------------------------
1010
# Common Test flags.

0 commit comments

Comments
 (0)