This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20229] -Wcast-qual option is easily evaded
- 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:55:36 -0000
- Subject: [Bug c/20229] -Wcast-qual option is easily evaded
- References: <20050227044915.20229.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:55 -------
It is precisely because it is "useful" to programmers in the manner described
that a check is needed on it so that persons charged with the task of code
validation or modification do not have to read 250,000 lines of code to find
"clever" little hacks that have been inserted to "fix" otherwise "inconvenient"
problems.
If you want to pick nits about casting to a pointer removing the target type
completely: fine. That is a perfectly reasonable technicality. However, in that
event, I would suggest that a separate option be added that exhibits the
behavior I describe by flagging ALL cases where a qualifier is discarded. Such
an option would be significantly more useful to code maintainers (as opposed to
the original authors of the code) in uncovering places where things go "boom"
when code is extended or modified.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20229