Integer as array?

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Mon Apr 8 07:47:00 GMT 2002


At 16:31 08.04.2002, Cyril Nguyen Huu wrote:
>Here is a code I tried - and succeed - to compile with several versions of
>gcc:
>int main(int argc, char **argv)
>{
>   return argc["hello"];
>}
>It compile without a warning, and seems to return a random result 
>depending on
>the platform and versions of gcc.
>I looked at the code of the gcc 3.1 20020325 (prerelease) and found some code
>that swap the array and the index if the subscripted variable is of type
>integer, while type checking. Is it a bug? If it is not a bug, what is it
>for?

Not a bug, see <http://www.eskimo.com/~scs/C-faq/q6.11.html>

Franz.



More information about the Gcc-bugs mailing list