Code::Blocks doesn't like my enums and typedefs

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 ...

  1. #16
    Registered User
    Join Date
    Oct 2005
    Posts
    14
    Quote Originally Posted by laserlight View Post
    Which version of MSVC did you use? I suggest testing with this:
    I was using Microsoft VC++ Express 2005 with SP1.

  2. #17
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,443
    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

  3. #18
    Registered User
    Join Date
    Oct 2005
    Posts
    14
    Actually I'll have to reboot to do that but i'll give it a shot. brb

  4. #19
    Registered User
    Join Date
    Oct 2005
    Posts
    14
    Code:
    #include <iostream>
    
    int main()
    {
        std::cout << sizeof int << std::endl;
    }
    I received the compiler error for this like expected. Then I modified it for a typedef:

    Code:
    #include <iostream>
    
    typedef int int32;
    
    int main()
    {
        std::cout << sizeof int32 << std::endl;
    }
    And it compiled without error using VC++ Express 2005.

    This has been fun, bit of a mind boggle huh

  5. #20
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,443
    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

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21