From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7769 invoked by alias); 30 Dec 2001 16:26:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7739 invoked by uid 71); 30 Dec 2001 16:26:02 -0000 Date: Sun, 30 Dec 2001 08:26:00 -0000 Message-ID: <20011230162602.7738.qmail@sources.redhat.com> To: nathan@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Nathan Sidwell Subject: Re: c++/5089: -Wold-style-cast warns about cast to void Reply-To: Nathan Sidwell X-SW-Source: 2001-12/txt/msg01230.txt.bz2 List-Id: The following reply was made to PR c++/5089; it has been noted by GNATS. From: Nathan Sidwell To: jturner Cc: nathan , gcc-gnats , gcc , law , dosreis Subject: Re: c++/5089: -Wold-style-cast warns about cast to void Date: Sun, 30 Dec 2001 16:17:33 +0000 Jeffrey Turner wrote: > >This question came up recently on a gcc mailing list. > >Is there a C++ way to cast something to a void? You're missing the point. No one claimed that static_cast (foo) was wrong. The problem is a) the assert macro b) static_cast (foo) is a mouthful which obscures what you're trying to do. thinks: why am I ignoring the result of a static_cast?, oh I see the target type is void. Much more up front is to have the 'void' at the start of the expression. void is a singularity in the type system, and I beleive -Wold-style-cast should treat it as such. nathan -- Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC 'But that's a lie.' - 'Yes it is. What's your point?' nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org