+Mon Oct 11 14:02:40 1999 Geoffrey Keating <geoffk@cygnus.com>
+
+ * as.c (show_usage): Document new options.
+ (parse_args): Add --no-warn, --warn, --fatal-warnings,
+ which become 'W', OPTION_WARN, and OPTION_WARN_FATAL.
+ (parse_args): Parse the new options.
+ (main): If there were warnings, and --fatal-warnings
+ was specified, print an error.
+ * as.h: New variable, flag_fatal_warnings, for new option.
+
Sun Oct 10 01:47:23 1999 Jerry Quinn <jerry.quinn.adv91@alum.dartmouth.org>
* config/tc-hppa.c (pa_ip): Add new codes 'cc', 'cd', 'cC', 'co',
--strip-local-absolute strip local absolute symbols\n\
--traditional-format Use same format as native assembler when possible\n\
--version print assembler version number and exit\n\
- -W suppress warnings\n\
+ -W --no-warn suppress warnings\n\
+ --warn don't suppress warnings\n\
+ --fatal-warnings treat warnings as errors\n\
--itbl INSTTBL extend instruction set to include instructions\n\
matching the specifications defined in file INSTTBL\n\
-w ignored\n\
#define OPTION_TRADITIONAL_FORMAT (OPTION_STD_BASE + 16)
{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
#define OPTION_GDWARF2 (OPTION_STD_BASE + 17)
- {"gdwarf2", no_argument, NULL, OPTION_GDWARF2}
+ {"gdwarf2", no_argument, NULL, OPTION_GDWARF2},
+ {"no-warn", no_argument, NULL, 'W'},
+#define OPTION_WARN (OPTION_STD_BASE + 18)
+ {"warn", no_argument, NULL, OPTION_WARN},
+#define OPTION_WARN_FATAL (OPTION_STD_BASE + 19)
+ {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
};
/* Construct the option lists from the standard list and the
flag_no_warnings = 1;
break;
+ case OPTION_WARN:
+ flag_no_warnings = 0;
+ flag_fatal_warnings = 0;
+ break;
+
+ case OPTION_WARN_FATAL:
+ flag_no_warnings = 0;
+ flag_fatal_warnings = 1;
+ break;
+
case 'Z':
flag_always_generate_output = 1;
break;
output_file_close (out_file_name);
#endif
+ if (flag_fatal_warnings && had_warnings() > 0 && had_errors () == 0)
+ as_bad (_("%d warnings, treating warnings as errors"), had_warnings());
+
if (had_errors () > 0 && ! flag_always_generate_output)
keep_it = 0;
/* True if warnings should be inhibited. */
COMMON int flag_no_warnings; /* -W */
+/* True if warnings count as errors. */
+COMMON int flag_fatal_warnings; /* --fatal-warnings */
+
/* True if we should attempt to generate output even if non-fatal errors
are detected. */
COMMON unsigned char flag_always_generate_output; /* -Z */
.B as\c
\& version
.TP
-.B \-W
-Suppress warning messages
+.B \-W, \-\-no-warn
+Suppress warning messages.
+.TP
+.B \-\-fatal\-warnings
+Consider warnings to be fatal.
+.TP
+.B \-\-warn
+Just warn on warnings.
.TP
.IR "\-\^\-" "\ |\ " "files\|.\|.\|."
Source files to assemble, or standard input (\c
@value{AS} [ -a[cdhlns][=file] ] [ -D ] [ --defsym @var{sym}=@var{val} ]
[ -f ] [ --gstabs ] [ --gdwarf2 ] [ --help ] [ -I @var{dir} ] [ -J ] [ -K ] [ -L ]
[ --keep-locals ] [ -o @var{objfile} ] [ -R ] [ --statistics ] [ -v ]
- [ -version ] [ --version ] [ -W ] [ -w ] [ -x ] [ -Z ]
+ [ -version ] [ --version ] [ -W ] [ --warn ] [ --fatal-warnings ]
+ [ -w ] [ -x ] [ -Z ]
@ifset A29K
@c am29k has no machine-dependent assembler options
@end ifset
Print the @code{as} version and exit.
@item -W
+@itemx --no-warn
Suppress warning messages.
+@item --fatal-warnings
+Treat warnings as errors.
+
+@item --warn
+Don't suppress warning messages or treat them as errors.
+
@item -w
Ignored.
* statistics:: --statistics to see statistics about assembly
* traditional-format:: --traditional-format for compatible output
* v:: -v to announce version
-* W:: -W to suppress warnings
+* W:: -W, --no-warn, --warn, --fatal-warnings to control warnings
* Z:: -Z to make object file even after errors
@end menu
command line.
@node W
-@section Suppress Warnings: @code{-W}
+@section Control Warnings: @code{-W}, @code{--warn}, @code{--no-warn}, @code{--fatal-warnings}
-@kindex -W
-@cindex suppressing warnings
-@cindex warnings, suppressing
@code{@value{AS}} should never give a warning or error message when
assembling compiler output. But programs written by people often
cause @code{@value{AS}} to give a warning that a particular assumption was
made. All such warnings are directed to the standard error file.
-If you use this option, no warnings are issued. This option only
-affects the warning messages: it does not change any particular of how
-@code{@value{AS}} assembles your file. Errors, which stop the assembly, are
-still reported.
+
+@kindex @samp{-W}
+@kindex @samp{--no-warn}
+@cindex suppressing warnings
+@cindex warnings, suppressing
+If you use the @code{-W} and @code{--no-warn} options, no warnings are issued.
+This only affects the warning messages: it does not change any particular of
+how @code{@value{AS}} assembles your file. Errors, which stop the assembly,
+are still reported.
+
+@kindex @samp{--fatal-warnings}
+@cindex errors, caused by warnings
+@cindex warnings, causing error
+If you use the @code{--fatal-warnings} option, @code{@value{AS}} considers
+files that generate warnings to be in error.
+
+@kindex @samp{--warn}
+@cindex warnings, switching on
+You can switch these options off again by specifying @code{--warn}, which
+causes warnings to be output as usual.
@node Z
@section Generate Object File in Spite of Errors: @code{-Z}