http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59940
Bug ID: 59940
Summary: Imprecise column number for -Wconversion
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengniansun at gmail dot com
The column numbers of conversion warnings are not precise.
$: cat s.c
int f(unsigned i);
int g(int i) {
return f(i) + f(i)
+ f(i);
}
$: gcc-trunk -c -Wconversion s.c
s.c: In function ‘g’:
s.c:4:1: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign
of the result [-Wsign-conversion]
return f(i) + f(i)
^
s.c:4:1: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign
of the result [-Wsign-conversion]
s.c:5:19: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign
of the result [-Wsign-conversion]
+ f(i);
^
$: clang-trunk -c -Wconversion s.c
s.c:4:16: warning: implicit conversion changes signedness: 'int' to 'unsigned
int' [-Wsign-conversion]
return f(i) + f(i)
~ ^
s.c:4:23: warning: implicit conversion changes signedness: 'int' to 'unsigned
int' [-Wsign-conversion]
return f(i) + f(i)
~ ^
s.c:5:23: warning: implicit conversion changes signedness: 'int' to 'unsigned
int' [-Wsign-conversion]
+ f(i);
~ ^
3 warnings generated.
$: gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/chengniansun/tools/gcc-trunk-binaries/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --enable-languages=c,c++
--disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries :
(reconfigured) ../gcc-trunk/configure --enable-languages=c,c++
--disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries
Thread model: posix
gcc version 4.9.0 20140123 (experimental) (GCC)