[Bug c/63710] Incorrect column number for -Wconversion

2019-08-04 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63710

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||dodji at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
cc-ing diagnostics maintainers

[Bug c/63710] Incorrect column number for -Wconversion

2018-07-30 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63710

Eric Gallager  changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
cc-ing "new -Wconversion" author

[Bug c/63710] Incorrect column number for -Wconversion

2017-07-30 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63710

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-07-30
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Eric Gallager  ---
Confirmed. The location for the first one is still the same, but the location
for the second one has changed:

$ /usr/local/bin/gcc -c -Wconversion 63710.c
63710.c: In function ‘f1’:
63710.c:2:24: warning: conversion to ‘long unsigned int’ from ‘char’ may change
the sign of the result [-Wsign-conversion]
  unsigned long r1 = ul + l;
^
63710.c:3:23: warning: conversion to ‘long unsigned int’ from ‘char’ may change
the sign of the result [-Wsign-conversion]
  unsigned long r2 = l + ul;
   ^
63710.c: In function ‘f2’:
63710.c:8:15: warning: conversion to ‘unsigned int’ from ‘char’ may change the
sign of the result [-Wsign-conversion]
  return l ? l : c;
 ~~^~~
63710.c:8:15: warning: conversion to ‘unsigned int’ from ‘long int’ may change
the sign of the result [-Wsign-conversion]
$

I agree that both could still be better.

[Bug c/63710] Incorrect column number for -Wconversion

2014-11-07 Thread chengniansun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63710

--- Comment #1 from Chengnian Sun chengniansun at gmail dot com ---
I find the following test case, which seems related to this bug. The locations
of both warnings point to the condition instead of the expressions which
require conversion. 


$: cat t.c
unsigned f(long l, char c) {
  return l ? l : c;
}
$: 
$: gcc-trunk -Wconversion t.c -c
t.c: In function ‘f’:
t.c:2:10: warning: conversion to ‘unsigned int’ from ‘char’ may change the sign
of the result [-Wsign-conversion]
   return l ? l : c;
  ^
t.c:2:10: warning: conversion to ‘unsigned int’ from ‘long int’ may alter its
value [-Wconversion]
$: 
$: 
$: clang-trunk -Wconversion t.c -c
t.c:2:18: warning: operand of ? changes signedness: 'char' to 'unsigned int'
[-Wsign-conversion]
  return l ? l : c;
  ~~ ^
t.c:2:14: warning: implicit conversion loses integer precision: 'long' to
'unsigned int' [-Wshorten-64-to-32]
  return l ? l : c;
  ~~ ^
2 warnings generated.