[Bug c/60129] Imprecise column numbers in NOTEs on discarding const qualifiers from pointer target type
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 25 15:54:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60129
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
gcc 8 now underlines the pertinent parameter (as of r253411 and r253096 for
C/C++ respectively):
C:
$ ./xgcc -B. -c t.c
t.c: In function ‘fn2’:
t.c:3:7: warning: passing argument 1 of ‘fn1’ discards ‘const’ qualifier from
pointer target type [-Wdiscarded-qualifiers]
fn1(a, a);
^
t.c:1:17: note: expected ‘char *’ but argument is of type ‘const char *’
extern void fn1(char*, char*);
^~~~~
t.c:3:10: warning: passing argument 2 of ‘fn1’ discards ‘const’ qualifier from
pointer target type [-Wdiscarded-qualifiers]
fn1(a, a);
^
t.c:1:24: note: expected ‘char *’ but argument is of type ‘const char *’
extern void fn1(char*, char*);
^~~~~
C++ (which also now underlines the pertinent argument, as of r256448):
$ ./xg++ -B. -c t.c
t.c: In function ‘void fn2(const char*)’:
t.c:3:7: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
fn1(a, a);
^
t.c:1:17: note: initializing argument 1 of ‘void fn1(char*, char*)’
extern void fn1(char*, char*);
^~~~~
t.c:3:10: error: invalid conversion from ‘const char*’ to ‘char*’
[-fpermissive]
fn1(a, a);
^
t.c:1:24: note: initializing argument 2 of ‘void fn1(char*, char*)’
extern void fn1(char*, char*);
^~~~~
More information about the Gcc-bugs
mailing list