BUG: C1001 in Third-Party STL Code Using Visual Studio 97 SP3

Last reviewed: February 10, 1998
Article ID: Q178512
The information in this article applies to:
  • The C/C++ Compiler (CL.EXE) included with:

        - Microsoft Visual C++, 32-bit Editions, version 5.0sp3
    
  • Microsoft Visual Studio 97sp3

SYMPTOMS

If you are using a third-party Standard Template Library (STL) (such as the Hewlett-Packard implementation), and compile after applying Visual Studio 97 Service Pack 3, the following error may be generated:

   testerr.cpp
   bstring.h(2322) : fatal error C1001: INTERNAL COMPILER ERROR
                   (compiler file 'E:\utc\src\\P2\main.c', line 379)
       Please choose the Technical Support command on the Visual C++
       Help menu, or open the Technical Support help file for more
       Information.

RESOLUTION

The following are suggested workarounds:

  1. Separate the construction and return of a temporary object. In the example below, replace the return statement with the respective commented statements:

           if (length())
          {
    
               return basic_string<charT>(data()+pos, (n > (length()-pos)) ?
                      (length()-pos) : n);
               //basic_string<charT> bt(data()+pos, (n > (length()-pos)) ?
               //     (length()-pos) : n);
               //return bt;
          }
           else
          {
           return basic_string<charT>();// C1001 on this line
               // basic_string<charT> bt;
               // return bt;
          }
       }
    
    

  2. Use Visual Studio 97 SP2.

  3. Instead of using the Hewlett-Packard STL, use the STL provided in Visual C++ 5.0. See any STL sample in the Visual C++ Online documentation for usage information. You may also read the comprehensive information provided on the Web at:

          http://www.microsoft.com/visualc/stl.
    

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords          : CLIss VS97BuglistSP3
Version           : WINNT:5.0sp3,97sp3
Platform          : winnt
Issue type        : kbbug
Solution Type     : kbservicepack kbworkaround


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 10, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.