From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25530 invoked by alias); 22 Nov 2004 15:21:45 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 25393 invoked from network); 22 Nov 2004 15:21:38 -0000 Received: from unknown (HELO smtp20.libero.it) (193.70.192.147) by sourceware.org with SMTP; 22 Nov 2004 15:21:38 -0000 Received: from localhost (172.16.1.83) by smtp20.libero.it (7.0.027-DD01) id 40E3F8E701E5AB2F; Mon, 22 Nov 2004 16:21:36 +0100 Received: from [151.41.184.47] (151.41.184.47) by smtp20.libero.it (7.0.027-DD01) id 40E3F8E2055ED3AF; Mon, 22 Nov 2004 16:21:36 +0100 Received: from 127.0.0.1 (AVG SMTP 7.0.289 [265.4.1]); Mon, 22 Nov 2004 16:24:11 +0100 Message-ID: <1d6601c4d0a7$510abab0$2fb82997@bagio> From: "Giovanni Bajo" To: =?iso-8859-1?Q?Richter=2C_J=F6rg?= Cc: References: Subject: Re: Warn implicit enum conversions Date: Mon, 22 Nov 2004 18:52:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at libero.it serv4 X-SW-Source: 2004-11/txt/msg00750.txt.bz2 Richter, Jörg wrote: > I can't imagine, that this demand is so uncommon. Perhaps someone > knows of a patch that does something like this? Or alternatively you > can point me to some functions in gcc where I can start to try to > implement it myself? > Ah yes, I need it for C++. Look into cp/cvt.c, ocp_convert(). It already handles errors for enum to enum conversion and integer to enum conversion, so you can add your warning there. Googling a bit should give you at list one link to a patch adding a new warning message (get something recent!), so that you see all the places you need to updated. Remember to work on mainline, not a release branch. Giovanni Bajo