This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17654] Pointless warning on incompatible pointer types
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2004 15:14:45 -0000
- Subject: [Bug c/17654] Pointless warning on incompatible pointer types
- References: <20040924151647.17654.jbeulich@novell.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jbeulich at novell dot com 2004-09-27 15:14 -------
Perhaps giving not just the sample, but a more complete example helps: Consider
having a structure with a field being a head of a linked list (of pointer type).
There are functions which may modify this list, and others which only traverse
it. Further consider that proper locking has to be done prior to accessing the
list head. If this locking is to be done inside the manipulating functions (as I
would always try to do), the the callers of these functions will have to pass
the address of the structure member (i.e. a pointer to a pointer). Now, since
there are cases where I have to pass pointers to non-const, the structure field
itself can neither itself be const nor be a pointer to const. However, for those
functions that don't modify the list, const-correct programming calls for a
parameter declaration with all levels being const modified. With the current
(standard conforming) warning, this is not possible in a program that e.g. uses
-Werror.
Thus I continue to believe that this is an omission on the part of the standard,
and would hence want to see gcc provide at least an optional way to circumvent
this problem.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17654