http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60129
Bug ID: 60129
Summary: Imprecise column numbers in NOTEs on discarding const
qualifiers from pointer target type
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 in the NOTEs are not precise. They are especially not clear
when the function fn1() has two parameters of the same type.
Regarding the column numbers in the warnings, I am not sure whether they are
expected as designed, as based on the warning message the user can still be
able to infer which parameter such a warning is about.
$: cat incorrect-col-write-string.c
extern void fn1(char*, char*);
void fn2(const char* a) {
fn1(a, a);
}
$: gcc-trunk -c incorrect-col-write-string.c
incorrect-col-write-string.c: In function ‘fn2’:
incorrect-col-write-string.c:3:3: warning: passing argument 1 of ‘fn1’ discards
‘const’ qualifier from pointer target type [enabled by default]
fn1(a, a);
^
incorrect-col-write-string.c:1:13: note: expected ‘char *’ but argument is of
type ‘const char *’
extern void fn1(char*, char*);
^
incorrect-col-write-string.c:3:3: warning: passing argument 2 of ‘fn1’ discards
‘const’ qualifier from pointer target type [enabled by default]
fn1(a, a);
^
incorrect-col-write-string.c:1:13: note: expected ‘char *’ but argument is of
type ‘const char *’
extern void fn1(char*, char*);
^
$