--- Comment #15 from tom dot browder at gmail dot com 2007-11-24 02:36
---
Tried:
g++ -c -Wconversion test_conversion.cc
using g++ trunk of svn version 30392 and had no warnings.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34198
--- Comment #13 from manu at gcc dot gnu dot org 2007-11-23 14:12 ---
(In reply to comment #12)
(In reply to comment #11)
Fixed.
I think this fix is wrong. Warning about user-provided casts goes against the
idea of Wconversion.
Forget it. I didn't read the testcases
--- Comment #12 from manu at gcc dot gnu dot org 2007-11-23 13:58 ---
(In reply to comment #11)
Fixed.
I think this fix is wrong. Warning about user-provided casts goes against the
idea of Wconversion.
See also
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01221.html
for a more
--- Comment #11 from jakub at gcc dot gnu dot org 2007-11-23 13:43 ---
Fixed.
--
jakub at gcc dot gnu dot org changed:
What|Removed |Added
Status|ASSIGNED
--- Comment #10 from jakub at gcc dot gnu dot org 2007-11-23 13:39 ---
Subject: Bug 34198
Author: jakub
Date: Fri Nov 23 13:39:44 2007
New Revision: 130377
URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=130377
Log:
PR c++/34198
* c-common.c (conversion_warning):
--- Comment #14 from fang at csl dot cornell dot edu 2007-11-23 19:10
---
Yes, thank you all for the quick response. Will test upcoming snapshot.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34198
--- Comment #2 from tom dot browder at gmail dot com 2007-11-22 21:37
---
Created an attachment (id=14617)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14617action=view)
Intermediate file produced by g++-4.3-20071109
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34198
--- Comment #1 from tom dot browder at gmail dot com 2007-11-22 21:35
---
Created an attachment (id=14616)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14616action=view)
Output from running: g++-4.3-20071109 -v -save-temps -c test_conversion.cc
--
--- Comment #3 from fang at csl dot cornell dot edu 2007-11-22 21:52
---
I'm having some issues with this as well (same snapshot):
some more tests:
void f(const unsigned char b)
{
unsigned char c = static_castunsigned char(b 0xff);
unsigned char d = (unsigned char)(b 0xff);
char
--- Comment #5 from jakub at gcc dot gnu dot org 2007-11-22 23:04 ---
See the shorten code in e.g. c-typeck.c's build_binary_op.
I think there are two possible fixes:
1) if shortening (i.e. final_type != result_type) don't convert_and_check
to result_type, but instead convert to
--- Comment #4 from manu at gcc dot gnu dot org 2007-11-22 22:43 ---
(In reply to comment #3)
IMHO, the explicit casts (static_cast or function-style) should suppress the
warnings.
That is not the problem. The explicit casts suppress the warnings for the
implicit conversion that
--- Comment #6 from tom dot browder at gmail dot com 2007-11-23 02:03
---
Created an attachment (id=14623)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14623action=view)
Output from running: g++-4.3-20071109 -v -save-temps -c -wconversion
test_conversion.cc
--
tom dot browder
--- Comment #9 from manu at gcc dot gnu dot org 2007-11-23 04:19 ---
@Jakub
BTW, perhaps get_unwidened is more appropriate for this, since it takes into
account the target type.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34198
--- Comment #8 from manu at gcc dot gnu dot org 2007-11-23 04:01 ---
(In reply to comment #5)
I think 2) is strongly preferrable.
Will try a patch tomorrow^H^H^H^H^H^H^H^Htoday.
I think so as well. Thanks for taking the bug. Let me know if you need help,
lose interest or don't have
--- Comment #7 from tom dot browder at gmail dot com 2007-11-23 02:05
---
Created an attachment (id=14624)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14624action=view)
Intermediate file produced by g++-4.3-20071109
--
tom dot browder at gmail dot com changed:
15 matches
Mail list logo