Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdb.cp/overload.cc: add cast to prevent compiler warning
@ 2011-02-27 21:16 Michael Snyder
  2011-02-28  5:08 ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2011-02-27 21:16 UTC (permalink / raw)
  To: gdb-patches

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

The compiler warning prevents this test from actually running.


[-- Attachment #2: overload.txt --]
[-- Type: text/plain, Size: 630 bytes --]

2011-02-27  Michael Snyder  <msnyder@vmware.com>

	* gdb.cp/overload.cc: Add cast to prevent compiler warning.

Index: gdb.cp/overload.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/overload.cc,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 overload.cc
--- gdb.cp/overload.cc	4 Nov 2010 20:43:25 -0000	1.7
+++ gdb.cp/overload.cc	27 Feb 2011 21:00:47 -0000
@@ -110,7 +110,7 @@ int main () 
     unsigned long arg10 =10;
     float arg11 =100.0;
     double arg12 = 200.0;
-    int arg13 = 200.0;
+    int arg13 = (int) 200.0;
     char arg14 = 'a';
 
     A a;

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

* Re: [RFA] gdb.cp/overload.cc: add cast to prevent compiler warning
  2011-02-27 21:16 [RFA] gdb.cp/overload.cc: add cast to prevent compiler warning Michael Snyder
@ 2011-02-28  5:08 ` Joel Brobecker
  2011-02-28 18:03   ` Michael Snyder
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2011-02-28  5:08 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> 2011-02-27  Michael Snyder  <msnyder@vmware.com>
> 
> 	* gdb.cp/overload.cc: Add cast to prevent compiler warning.
> 
> Index: gdb.cp/overload.cc
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/overload.cc,v
> retrieving revision 1.7
> diff -u -p -u -p -r1.7 overload.cc
> --- gdb.cp/overload.cc	4 Nov 2010 20:43:25 -0000	1.7
> +++ gdb.cp/overload.cc	27 Feb 2011 21:00:47 -0000
> @@ -110,7 +110,7 @@ int main () 
>      unsigned long arg10 =10;
>      float arg11 =100.0;
>      double arg12 = 200.0;
> -    int arg13 = 200.0;
> +    int arg13 = (int) 200.0;

Why not just write this as:

       int arg13 = 200;

?

-- 
Joel


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

* Re: [RFA] gdb.cp/overload.cc: add cast to prevent compiler warning
  2011-02-28  5:08 ` Joel Brobecker
@ 2011-02-28 18:03   ` Michael Snyder
  2011-02-28 18:17     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2011-02-28 18:03 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker wrote:
>> 2011-02-27  Michael Snyder  <msnyder@vmware.com>
>>
>> 	* gdb.cp/overload.cc: Add cast to prevent compiler warning.
>>
>> Index: gdb.cp/overload.cc
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/overload.cc,v
>> retrieving revision 1.7
>> diff -u -p -u -p -r1.7 overload.cc
>> --- gdb.cp/overload.cc	4 Nov 2010 20:43:25 -0000	1.7
>> +++ gdb.cp/overload.cc	27 Feb 2011 21:00:47 -0000
>> @@ -110,7 +110,7 @@ int main () 
>>      unsigned long arg10 =10;
>>      float arg11 =100.0;
>>      double arg12 = 200.0;
>> -    int arg13 = 200.0;
>> +    int arg13 = (int) 200.0;
> 
> Why not just write this as:
> 
>        int arg13 = 200;
> 


I don't know -- I dunno what the author's intention was.


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

* Re: [RFA] gdb.cp/overload.cc: add cast to prevent compiler warning
  2011-02-28 18:03   ` Michael Snyder
@ 2011-02-28 18:17     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-02-28 18:17 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Joel Brobecker, gdb-patches

>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:

>> int arg13 = 200;

Michael> I don't know -- I dunno what the author's intention was.

I'm sure it is just a paste-o.
Anyway the two are identical, but writing plain "200" is not confusing
and weird.

Tom


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

end of thread, other threads:[~2011-02-28 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-27 21:16 [RFA] gdb.cp/overload.cc: add cast to prevent compiler warning Michael Snyder
2011-02-28  5:08 ` Joel Brobecker
2011-02-28 18:03   ` Michael Snyder
2011-02-28 18:17     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox