Enum type check

naveen yadav yad.naveen@gmail.com
Tue Jun 15 10:28:00 GMT 2010


Hi all ,

If we compile attached c file (enum.c), build result is different
between C & C++ compiler.

example:
[naveen@localhost ~]$ gcc enum.c
[naveen@localhost ~]$ g++ enum.c
enum.c: In function âint main()â:
enum.c:13: error: cannot convert âtypeBâ to âtypeAâ in assignment
[naveen@localhost ~]$


Is there any flag/option in GCC to catch this issue, which we can do
easily in G++.

thanks
naveen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enum.c
Type: application/octet-stream
Size: 195 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20100615/4e345f4f/attachment.obj>


More information about the Gcc-help mailing list