This is the mail archive of the gcc-help@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: Prohibit enum <-> int mixup


* Enrico Weigelt <weigelt@metux.de> wrote:

> > I assume you are talking about C.  Try -Wc++-compat.  However, that will
> > warn about a number of things other than enum comparisons.  There is no
> > option to pull out the specific enum checks from the rest of the C++
> > compatibility checks.
> 
> I'm using C++. It already warns me about a few things, eg. missing
> case's in switch statements. But it still accepts assigning 
> enum to int and vice versa.

Just had a little test w/ zlib:
It doesn't compile out of the box, but the fixes seem to be
quite simple (eg. function parameter declarations).


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------


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