From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22350 invoked by alias); 22 Nov 2004 15:19:53 -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 22095 invoked from network); 22 Nov 2004 15:19:41 -0000 Received: from unknown (HELO smtp1.libero.it) (193.70.192.51) by sourceware.org with SMTP; 22 Nov 2004 15:19:41 -0000 Received: from localhost (172.16.1.84) by smtp1.libero.it (7.0.027-DD01) id 40C7315F023E9008; Mon, 22 Nov 2004 16:19:52 +0100 Received: from [151.41.184.47] (151.41.184.47) by smtp0.libero.it (7.0.027-DD01) id 40CB280C064A4139; Mon, 22 Nov 2004 16:19:38 +0100 Received: from 127.0.0.1 (AVG SMTP 7.0.289 [265.4.1]); Mon, 22 Nov 2004 16:22:13 +0100 Message-ID: <1d2401c4d0a7$0b235fc0$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 15:39: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 serv5 X-SW-Source: 2004-11/txt/msg00749.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