From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16086 invoked by alias); 27 Feb 2005 05:03:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16075 invoked by uid 48); 27 Feb 2005 05:02:59 -0000 Date: Sun, 27 Feb 2005 16:08:00 -0000 Message-ID: <20050227050259.16074.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050227044915.20229.kmk@ssl.org> References: <20050227044915.20229.kmk@ssl.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/20229] -Wcast-qual option is easily evaded X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg03286.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-27 05:02 ------- Nope the following cannot be warned about because you first change the pointer to an integer and then cast it to a char pointer which is only defined iff int is the same size as the pointer (which is warned about on 64bit targets): // This, however, does not warn...but should: evil_string_modifier((char *)(int)"Test string three."); Not warning is correct as there is a cast inbetween. the docs are clear: Warn whenever a pointer is cast so as to remove a type qualifier from the target type. For example, warn if a const char * is cast to an ordinary char *. Since the cast to int is inbetween there, the warning does not makes sense any more. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Component|debug |c Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20229