From 96773ebcef2fe5949695a4fd923343ec4b049087 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 15 Dec 2009 16:56:13 +0100 Subject: Add option -Werror in erlc(1) Like in gcc, this option treats warnings as errors. --- erts/etc/common/erlc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'erts/etc') diff --git a/erts/etc/common/erlc.c b/erts/etc/common/erlc.c index c958fed741..216ff7f40e 100644 --- a/erts/etc/common/erlc.c +++ b/erts/etc/common/erlc.c @@ -310,6 +310,8 @@ main(int argc, char** argv) case 'W': /* Enable warnings. */ if (strcmp(argv[1]+2, "all") == 0) { PUSH2("@warn", "999"); + } else if (strcmp(argv[1]+2, "error") == 0) { + PUSH2("@option", "warnings_as_errors"); } else if (isdigit((int)argv[1][2])) { PUSH2("@warn", argv[1]+2); } else { @@ -566,6 +568,7 @@ usage(void) {"-pz path", "add path to the end of Erlang's code path"}, {"-smp", "compile using SMP emulator"}, {"-v", "verbose compiler output"}, + {"-Werror", "make all warnings into errors"}, {"-W0", "disable warnings"}, {"-Wnumber", "set warning level to number"}, {"-Wall", "enable all warnings"}, -- cgit v1.2.3