]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
compiler: Add --pedantic option to enable additional warnings
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 10 Apr 2023 18:16:13 +0000 (20:16 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 17 Apr 2023 19:02:56 +0000 (21:02 +0200)
compiler/valacompiler.vala
doc/valac.1
vala/valacodecontext.vala

index 13444d519f18e68b79dded74527791fb7e020040..708c87a5c22792747fd5afbbfa626de9cfea58e7 100644 (file)
@@ -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;
index 4fef4d0863e25539b31ecf01f7ba886928e38098..1e931b71a9b38957b0909a2a134a5aeda2e16be9 100644 (file)
@@ -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
index 63dacd1a3007b760b68fafec6979139ade917c46..28b084eb4c0fe828d036c59c6167bade518f9a3f 100644 (file)
@@ -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.
         */