This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31712] no warning on implicit cast from int to pointer
- From: "christoph dot wintersteiger at inf dot ethz dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Apr 2007 15:03:56 -0000
- Subject: [Bug c/31712] no warning on implicit cast from int to pointer
- References: <bug-31712-14469@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from christoph dot wintersteiger at inf dot ethz dot ch 2007-04-26 16:03 -------
Subject: Re: no warning on implicit cast from int to pointer
On Thu, 2007-04-26 at 14:56 +0000, pinskia at gcc dot gnu dot org wrote:
>
> ------- Comment #4 from pinskia at gcc dot gnu dot org 2007-04-26 15:56 -------
> >Thanks for clarifying. I still think it's completely confusing to have
> > a[b]==b[a] in general, but that's probably something that can't be changed
> > easily.
>
> Well, this is what the C standard says how this is defined. C++ on the other
> hand, is different.
>
>
Yep, you're right, the standard says that. The C++ standard says the
same for standard-[] (c-type arrays, I guess not for custom operator[]s
in classes).
Christoph
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31712