This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

casting const aways shouldn't be an error even with -pedantic-errors


The following code gives an error with -pedantic-errors -Wconst-qual.  It 
should only be a warning.

int *f(const int *p) { return (int*)p; } /* cast discards `const' from 
pointer target type */

command line: gcc -c -Wcast-qual -pedantic bug.c

gcc -v
Reading specs from 
/eda/tools/gnu/tools/egcs-1.1.2/sunos5.6/lib/gcc-lib/sparc-sun-solaris2.6/eg 
cs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

This is not very important but prevents me from using -pedantic-errors and 
-Wcast-qual at the same time.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]