From: Victor Santet Date: Thu, 28 Jun 2012 14:44:20 +0000 (+0200) Subject: warnings: move them to complain.c. X-Git-Tag: v2.7.90~414 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/d0f11c1b628c0bd3d11614a796da30cfd7dce927?ds=sidebyside warnings: move them to complain.c. * src/getargs.h, src/getargs.c (warnings, warnings_flags): Move to... * src/complain.h, src/complain.c: Here. --- diff --git a/src/complain.c b/src/complain.c index fc73cfe4..fadef5a1 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 2bb3795e..30e7c86d 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 warnings_flag & Werror. 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 0fbc403e..d0b1e948 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 9fc9aab9..4eb39812 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. *