This is a discussion on Code::Blocks doesn't like my enums and typedefs within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by laserlight Which version of MSVC did you use? I suggest testing with this: I was using Microsoft ...
That is very weird. We are essentially using the same compiler with compiler extensions turned on, but the results are different. Have you checked with my test program?
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Actually I'll have to reboot to do that but i'll give it a shot. brb
I received the compiler error for this like expected. Then I modified it for a typedef:Code:#include <iostream> int main() { std::cout << sizeof int << std::endl; }
And it compiled without error using VC++ Express 2005.Code:#include <iostream> typedef int int32; int main() { std::cout << sizeof int32 << std::endl; }
This has been fun, bit of a mind boggle huh
Thanks, I can confirm that. Since the behaviour remains the same even with compiler extensions turned off, I conclude that this is an area where the compiler simply does not conform to the standard.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way