Opened 11 years ago

Closed 11 years ago

#6429 closed Bugs (fixed)

Wrong range checks in compiler/visualc.hpp

Reported by: Ulrich Eckhardt <ulrich.eckhardt@…> Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost Development Trunk Severity: Problem
Keywords: wince Cc:

Description

There is a problem with the range checks, in particular they don't recognize the MIPS cross-compiler of VC8 correctly. This problem is present in the trunk but also in older released versions. I found the issue ininially in 1.48.

The problem there is caused by checks like _MSC_VER==1400 or _MSC_VER>1400. For the mentioned compiler, _MSC_VER is 1401 and it is bug-to-bug compatible with other 140x versions. Still, above checks fail to recognize it as such. The tests should be changed to _MSC_VER<1400 or _MSC_VER>=1400, with the assumption that all 14xx versions are compatible.

Some more notes:

  • This doesn't only affect version 140x, but also others, see e.g. the code for versions 1200, 1201 and 1202.
  • I think this file merits a list of known _MSC_VER values and the according systems, or a pointer to it, and a note why _MSC_VER==1400 is bad.
  • Near the bottom, there is a check that tests <1200 to reject those pre-VC6 compilers right away. I'd move that up to the top, because it is required context to fully understand the rest of the file.
  • There is a #pragma that disables a warning "..before we #include anything", but this file doesn't include anything. I'm wondering if that couldn't simply be removed or at least moved.
  • There are a few cases where preprocessor code isn't indented.
  • There is a comment "disable min/max macro defines on vc6:" but no code associated with that. I guess the code was rendered obsolete, at least I don't see any NOMINMAX define there.
  • There is a macro BOOST_MSVC_FULL_VER, but that macro is not used there. Unless this is unused, I'd add a comment or reference to the according documentation.
  • There is one check that BOOST_MSVC == 1202. Why does that use BOOST_MSVC instead of _MSC_VER? I'd also comment that, I think this was due to some fault in the ARM cross-compiler for CE5, but I also seem to remember that there was a workaround. I'll try to see if I can recover the exact case from STLport's history/documentation, where I think the workaround originated.

Attachments (1)

CE-versions.patch (1.9 KB ) - added by Ulrich Eckhardt <ulrich.eckhardt@…> 11 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by John Maddock, 11 years ago

Resolution: fixed
Status: newclosed

(In [76595]) Fix _MSC_VER version checks are current form doesn't work for MIPS cross compiler. Fixes #6429.

by Ulrich Eckhardt <ulrich.eckhardt@…>, 11 years ago

Attachment: CE-versions.patch added

comment:2 by Ulrich Eckhardt <ulrich.eckhardt@…>, 11 years ago

Resolution: fixed
Status: closedreopened

Thank you for the quick response! I would have filed patches but first wanted to gauge interest and whether to clean up the file along the way. There are a few checks missing though, see attached patch.

comment:3 by John Maddock, 11 years ago

Resolution: fixed
Status: reopenedclosed

(In [76774]) Apply version check patch. Fixes #6429.

Note: See TracTickets for help on using tickets.