From: Rico Tzschichholz Date: Mon, 10 Apr 2023 18:16:13 +0000 (+0200) Subject: compiler: Add --pedantic option to enable additional warnings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2cfa72468fe97d43756093e991a2ab6a217be99;p=thirdparty%2Fvala.git compiler: Add --pedantic option to enable additional warnings --- diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 13444d519..708c87a5c 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -74,6 +74,7 @@ class Vala.Compiler { static bool gobject_tracing; static bool disable_since_check; static bool disable_warnings; + static bool pedantic; static bool keep_going; static bool list_sources; static string cc_command; @@ -145,6 +146,7 @@ class Vala.Compiler { { "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 }, { "disable-since-check", 0, 0, OptionArg.NONE, ref disable_since_check, "Do not check whether used symbols exist in local packages", null }, + { "pedantic", 'p', 0, OptionArg.NONE, ref pedantic, "Output additional warnings", null }, { "keep-going", 'k', 0, OptionArg.NONE, ref keep_going, "Continue as much as possible after an error", null }, { "enable-experimental-non-null", 0, 0, OptionArg.NONE, ref experimental_non_null, "Enable experimental enhancements for non-null types", null }, { "enable-gobject-tracing", 0, 0, OptionArg.NONE, ref gobject_tracing, "Enable GObject creation tracing", null }, @@ -254,6 +256,7 @@ class Vala.Compiler { context.experimental_non_null = experimental_non_null; context.gobject_tracing = gobject_tracing; context.keep_going = keep_going; + context.pedantic = pedantic; context.report.enable_warnings = !disable_warnings; context.report.set_verbose_errors (!quiet_mode); context.verbose_mode = verbose_mode; diff --git a/doc/valac.1 b/doc/valac.1 index 4fef4d086..1e931b71a 100644 --- a/doc/valac.1 +++ b/doc/valac.1 @@ -147,6 +147,9 @@ Treat warnings as fatal \fB\-\-disable\-since\-check\fR Do not check whether used symbols exist in local packages .TP +\fB\-p\fR, \fB\-\-pedantic\fR +Output additional warnings +.TP \fB\-k\fR, \fB\-\-keep\-going\fR Continue as much as possible after an error .TP diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index 63dacd1a3..28b084eb4 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -61,6 +61,11 @@ public class Vala.CodeContext { */ public bool experimental_non_null { get; set; } + /** + * Enable pedantic warnings. + */ + public bool pedantic { get; set; } + /** * Enable GObject creation tracing. */