* options.h (class General_options): Add --fatal-warnings.
* main.cc (main): Implement --fatal-warnings. * errors.h (Errors::warning_count): New function.
This commit is contained in:
parent
f1f70eae28
commit
d82a5bcc85
4 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
||||||
2008-05-06 Ian Lance Taylor <iant@google.com>
|
2008-05-06 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
|
* options.h (class General_options): Add --fatal-warnings.
|
||||||
|
* main.cc (main): Implement --fatal-warnings.
|
||||||
|
* errors.h (Errors::warning_count): New function.
|
||||||
|
|
||||||
* options.h (class General_options): Add -Bsymbolic-functions.
|
* options.h (class General_options): Add -Bsymbolic-functions.
|
||||||
* symtab.h (Symbol::is_preemptible): Check for
|
* symtab.h (Symbol::is_preemptible): Check for
|
||||||
-Bsymbolic-functions.
|
-Bsymbolic-functions.
|
||||||
|
|
|
@ -93,6 +93,11 @@ class Errors
|
||||||
error_count() const
|
error_count() const
|
||||||
{ return this->error_count_; }
|
{ return this->error_count_; }
|
||||||
|
|
||||||
|
// Return the number of warnings.
|
||||||
|
int
|
||||||
|
warning_count() const
|
||||||
|
{ return this->warning_count_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Errors(const Errors&);
|
Errors(const Errors&);
|
||||||
Errors& operator=(const Errors&);
|
Errors& operator=(const Errors&);
|
||||||
|
|
|
@ -220,6 +220,11 @@ main(int argc, char** argv)
|
||||||
layout.print_stats();
|
layout.print_stats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parameters->options().fatal_warnings()
|
||||||
|
&& errors.warning_count() > 0
|
||||||
|
&& errors.error_count() == 0)
|
||||||
|
gold_error("treating warnings as errors");
|
||||||
|
|
||||||
// If the user used --noinhibit-exec, we force the exit status to be
|
// If the user used --noinhibit-exec, we force the exit status to be
|
||||||
// successful. This is compatible with GNU ld.
|
// successful. This is compatible with GNU ld.
|
||||||
gold_exit(errors.error_count() == 0
|
gold_exit(errors.error_count() == 0
|
||||||
|
|
|
@ -565,6 +565,10 @@ class General_options
|
||||||
DEFINE_bool(eh_frame_hdr, options::TWO_DASHES, '\0', false,
|
DEFINE_bool(eh_frame_hdr, options::TWO_DASHES, '\0', false,
|
||||||
N_("Create exception frame header"), NULL);
|
N_("Create exception frame header"), NULL);
|
||||||
|
|
||||||
|
DEFINE_bool(fatal_warnings, options::TWO_DASHES, '\0', false,
|
||||||
|
N_("Treat warnings as errors"),
|
||||||
|
N_("Do not treat warnings as errors"));
|
||||||
|
|
||||||
DEFINE_string(soname, options::ONE_DASH, 'h', NULL,
|
DEFINE_string(soname, options::ONE_DASH, 'h', NULL,
|
||||||
N_("Set shared library name"), N_("FILENAME"));
|
N_("Set shared library name"), N_("FILENAME"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue