#140 _bitset.h compiler error: "_STLP_MSVC" is not defined

5.1
closed
5
2007-08-31
2007-08-31
AndyC
No

When compiling with gcc -Wundef, we get a compilation error of:

.../stlport/stl/_bitset.h:723:34: "_STLP_MSVC" is not defined

Looking at that code:

# if !(defined (_STLP_MSVC) || (_STLP_MSVC < 1300)) && \ !(defined(__SUNPRO_CC) || (__SUNPRO_CC < 0x500))

that's clearly wrong - if _STLP_MSVC is not defined, it'll go on and test it for being less than 1300 which is going to cause a compilation error if -Wundef is in effect. Similarly the test on __SUNPROC_CC in the following line.

Discussion

  • AndyC

    AndyC - 2007-08-31

    Logged In: YES
    user_id=1878570
    Originator: YES

    I think that statement should look like:

    # if !(defined (_STLP_MSVC) && (_STLP_MSVC < 1300)) && \ !(defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x500))

    as the else clause was added to cope with those old versions of the compilers (I believe).

     
  • Francois Dumont

    Francois Dumont - 2007-08-31
    • assigned_to: nobody --> dums
     
  • Francois Dumont

    Francois Dumont - 2007-08-31
    • status: open --> closed
     
  • Francois Dumont

    Francois Dumont - 2007-08-31

    Logged In: YES
    user_id=1096600
    Originator: NO

    Fixed in STLPORT_5_1 branch.

    Thanks

     

Log in to post a comment.