static bool nostdpkg;
static bool enable_version_header;
static bool disable_version_header;
+ static bool fatal_warnings;
static string entry_point;
{ "enable-deprecated", 0, 0, OptionArg.NONE, ref deprecated, "Enable deprecated features", null },
{ "enable-experimental", 0, 0, OptionArg.NONE, ref experimental, "Enable experimental features", null },
{ "disable-warnings", 0, 0, OptionArg.NONE, ref disable_warnings, "Disable warnings", null },
+ { "fatal-warnings", 0, 0, OptionArg.NONE, ref fatal_warnings, "Treat warnings as fatal", null },
{ "enable-experimental-non-null", 0, 0, OptionArg.NONE, ref experimental_non_null, "Enable experimental enhancements for non-null types", null },
{ "disable-dbus-transformation", 0, 0, OptionArg.NONE, ref disable_dbus_transformation, "Disable transformation of D-Bus member names", null },
{ "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
if (context.report.get_errors () == 0 && context.report.get_warnings () == 0) {
return 0;
}
- if (context.report.get_errors () == 0) {
+ if (context.report.get_errors () == 0 && (!fatal_warnings || context.report.get_warnings () == 0)) {
if (!quiet_mode) {
stdout.printf ("Compilation succeeded - %d warning(s)\n", context.report.get_warnings ());
}
packages = null;
}
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}
}
sources = null;
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}
}
}
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}
var resolver = new SymbolResolver ();
resolver.resolve (context);
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}
code_writer.write_file (context, dump_tree);
}
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}
var flow_analyzer = new FlowAnalyzer ();
flow_analyzer.analyze (context);
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}
context.codegen.emit (context);
- if (context.report.get_errors () > 0) {
+ if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}