Hide Forgot
Description of problem: gcc compiler show false warning on correct code actually this source compiled by g++ compiler from same toolchain with same command line keys don't display this warning. Version-Release number of selected component (if applicable): gcc (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) How reproducible: Compile source, attached to this bug with '-Wall' key. Steps to Reproduce: 1. Compile source attached to this bug as listed below: Actual results: $ c99 -Wall test.c test.c: In function ‘main’: test.c:8:5: warning: passing argument 1 of ‘foo’ from incompatible pointer type [enabled by default] test.c:3:6: note: expected ‘const char * const*’ but argument is of type ‘char **’ $ Expected results: $ c99 -Wall test.c $ Additional info: $ c++ -Wall test.c $
Created attachment 555082 [details] test source code
The warning is correct. C and C++ are different languages, so it is not surprising that sometimes you get a warning or error in one of them and not the other one.