This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warn implicit enum conversions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]