This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warn implicit enum conversions
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: Richter, Jörg <Joerg dot Richter at pdv-FS dot de>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 22 Nov 2004 16:22:13 +0100
- Subject: Re: Warn implicit enum conversions
- References: <BE04DD7F49713C4C94B1A89A81CEFE1C0556D7@exch03.pdv-fs.de>
Richter, Jörg <Joerg.Richter@pdv-FS.de> 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