This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20230] GCC generates non-compliant warnings for qualifier promotion
- From: "kmk at ssl dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Feb 2005 21:37:19 -0000
- Subject: [Bug c/20230] GCC generates non-compliant warnings for qualifier promotion
- References: <20050227052446.20230.kmk@ssl.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kmk at ssl dot org 2005-02-27 21:37 -------
1. A pointer is a derived type.
2. A derived type is not qualified by the qualifiers (if any) of the type from
which it is derived.
3. For any qualifier q, a POINTER to a non-q-qualified type may be converted to
a pointer to the q-qualified version of the type. [emphasis mine; note that a
pointer is, by itself, a derived type which does not inherit any qualifiers---so
what]
4. A pointer to a pointer is itself a pointer.
5. The C standard, unlike C++, does not further restrict qualifier promotion of
multi-level pointers---in fact, it is completely silent on the issue.
6. By (3), above, the left-hand side of a pointer assignment can be converted so
that all qualifiers match.
I ask again: where is the problem?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20230