bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] warnings: move them to complain.c.


From: Victor Santet
Subject: [PATCH 2/3] warnings: move them to complain.c.
Date: Thu, 28 Jun 2012 16:44:20 +0200

* src/getargs.h, src/getargs.c (warnings, warnings_flags): Move to...
* src/complain.h, src/complain.c: Here.
---
 src/complain.c |    2 ++
 src/complain.h |   19 +++++++++++++++++++
 src/getargs.c  |    2 --
 src/getargs.h  |   18 ------------------
 4 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/src/complain.c b/src/complain.c
index fc73cfe..fadef5a 100644
--- a/src/complain.c
+++ b/src/complain.c
@@ -29,6 +29,8 @@
 #include "files.h"
 #include "getargs.h"
 
+int warnings_flag = Wconflicts_sr | Wconflicts_rr | Wother;
+
 bool complaint_issued;
 static unsigned *indent_ptr = 0;
 
diff --git a/src/complain.h b/src/complain.h
index 2bb3795..30e7c86 100644
--- a/src/complain.h
+++ b/src/complain.h
@@ -25,6 +25,25 @@
 extern "C" {
 # endif
 
+/*-------------.
+| --warnings.  |
+`-------------*/
+
+enum warnings
+  {
+    Wnone             = 0,      /**< Issue no warnings.  */
+    Werror            = 1 << 0, /**< Warnings are treated as errors.  */
+    Wmidrule_values   = 1 << 1, /**< Unset or unused midrule values.  */
+    Wyacc             = 1 << 2, /**< POSIXME.  */
+    Wconflicts_sr     = 1 << 3, /**< S/R conflicts.  */
+    Wconflicts_rr     = 1 << 4, /**< R/R conflicts.  */
+    Wother            = 1 << 5, /**< All other warnings.  */
+    Wall              = ~Werror /**< All above warnings.  */
+  };
+
+/** What warnings are issued.  */
+extern int warnings_flag;
+
 /** Record that a warning is about to be issued, and treat it as an
     error if <tt>warnings_flag & Werror</tt>.  This is exported
     only for the sake of Yacc-compatible conflict reports in conflicts.c.
diff --git a/src/getargs.c b/src/getargs.c
index 0fbc403..d0b1e94 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -61,8 +61,6 @@ bool glr_parser = false;
 
 int report_flag = report_none;
 int trace_flag = trace_none;
-int warnings_flag = Wconflicts_sr | Wconflicts_rr
-                    | Wother;
 
 static struct bison_language const valid_languages[] = {
   { "c", "c-skel.m4", ".c", ".h", true },
diff --git a/src/getargs.h b/src/getargs.h
index 9fc9aab..4eb3981 100644
--- a/src/getargs.h
+++ b/src/getargs.h
@@ -108,24 +108,6 @@ enum trace
 /** What debug items bison displays during its run.  */
 extern int trace_flag;
 
-/*-------------.
-| --warnings.  |
-`-------------*/
-
-enum warnings
-  {
-    Wnone             = 0,      /**< Issue no warnings.  */
-    Werror            = 1 << 0, /**< Warnings are treated as errors.  */
-    Wmidrule_values   = 1 << 1, /**< Unset or unused midrule values.  */
-    Wyacc             = 1 << 2, /**< POSIXME.  */
-    Wconflicts_sr     = 1 << 3, /**< S/R conflicts.  */
-    Wconflicts_rr     = 1 << 4, /**< R/R conflicts.  */
-    Wother            = 1 << 5, /**< All other warnings.  */
-    Wall              = ~Werror /**< All above warnings.  */
-  };
-/** What warnings are issued.  */
-extern int warnings_flag;
-
 
 /** Process the command line arguments.
  *
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]