This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Make the ODR detector emit errors instead of warnings
- From: Jeffrey Yasskin <jyasskin at google dot com>
- To: binutils at sourceware dot org
- Date: Thu, 22 Jul 2010 16:47:17 -0700
- Subject: [PATCH] Make the ODR detector emit errors instead of warnings
In a large build, it can be very easy to miss a link that emitted
warnings. Errors are much harder to miss, and seem appropriate for
problems that cause undefined behavior. If there are false positives,
users can avoid passing --detect-odr-violations on that link line.
2010-07-22 Jeffrey Yasskin <jyasskin@google.com>
* symtab.cc (Symbol_table::detect_odr_violations): Change warning to error.
Index: gold/symtab.cc
===================================================================
RCS file: /cvs/src/src/gold/symtab.cc,v
retrieving revision 1.141
diff -u -r1.141 symtab.cc
--- gold/symtab.cc 9 Jul 2010 01:34:31 -0000 1.141
+++ gold/symtab.cc 22 Jul 2010 23:38:49 -0000
@@ -3052,9 +3052,9 @@
if (line_nums.size() > 1)
{
- gold_warning(_("while linking %s: symbol '%s' defined in multiple "
- "places (possible ODR violation):"),
- output_file_name, demangle(symbol_name).c_str());
+ gold_error(_("while linking %s: symbol '%s' defined in multiple "
+ "places (possible ODR violation):"),
+ output_file_name, demangle(symbol_name).c_str());
for (std::map<std::string, std::string>::const_iterator it2 =
line_nums.begin();
it2 != line_nums.end();