public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Make the ODR detector emit errors instead of warnings
@ 2010-07-22 23:47 Jeffrey Yasskin
  2010-07-27  8:27 ` Ian Lance Taylor
  2010-07-27  8:28 ` Ian Lance Taylor
  0 siblings, 2 replies; 4+ messages in thread
From: Jeffrey Yasskin @ 2010-07-22 23:47 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

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.

[-- Attachment #2: odr_error.patch --]
[-- Type: text/x-patch, Size: 902 bytes --]

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();

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make the ODR detector emit errors instead of warnings
  2010-07-22 23:47 [PATCH] Make the ODR detector emit errors instead of warnings Jeffrey Yasskin
@ 2010-07-27  8:27 ` Ian Lance Taylor
  2010-07-27 16:37   ` Jeffrey Yasskin
  2010-07-27  8:28 ` Ian Lance Taylor
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2010-07-27  8:27 UTC (permalink / raw)
  To: Jeffrey Yasskin; +Cc: binutils

Jeffrey Yasskin <jyasskin@google.com> writes:

> 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.

I think --detect-odr-violations can be useful even if there are false
positives; e.g., one could filter the result for known false positives.
You can can use --fatal-warnings if you're sure that you want an error
here.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make the ODR detector emit errors instead of warnings
  2010-07-22 23:47 [PATCH] Make the ODR detector emit errors instead of warnings Jeffrey Yasskin
  2010-07-27  8:27 ` Ian Lance Taylor
@ 2010-07-27  8:28 ` Ian Lance Taylor
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2010-07-27  8:28 UTC (permalink / raw)
  To: Jeffrey Yasskin; +Cc: binutils

Jeffrey Yasskin <jyasskin@google.com> writes:

> 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.

I think --detect-odr-violations can be useful even if there are false
positives; e.g., one could filter the result for known false positives.
You can can use --fatal-warnings if you're sure that you want an error
here.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make the ODR detector emit errors instead of warnings
  2010-07-27  8:27 ` Ian Lance Taylor
@ 2010-07-27 16:37   ` Jeffrey Yasskin
  0 siblings, 0 replies; 4+ messages in thread
From: Jeffrey Yasskin @ 2010-07-27 16:37 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

On Tue, Jul 27, 2010 at 1:26 AM, Ian Lance Taylor <iant@google.com> wrote:
> Jeffrey Yasskin <jyasskin@google.com> writes:
>
>> 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.
>
> I think --detect-odr-violations can be useful even if there are false
> positives; e.g., one could filter the result for known false positives.
> You can can use --fatal-warnings if you're sure that you want an error
> here.

Ok.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-27 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-22 23:47 [PATCH] Make the ODR detector emit errors instead of warnings Jeffrey Yasskin
2010-07-27  8:27 ` Ian Lance Taylor
2010-07-27 16:37   ` Jeffrey Yasskin
2010-07-27  8:28 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).