KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q43393: No Explicit Limit on Length of Literal Strings In QuickC 2.00

Article: Q43393
Product(s): See article
Version(s): 2.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | s_c | mspl13_c
Last Modified: 12-NOV-1990

A string literal more than 512 characters long will compile, link, and
execute correctly with the Microsoft QuickC Compiler, Version 2.00.
However, the Microsoft C Optimizing Compiler, Version 5.10, gives the
following error message:

   filename.c(line #) : warning C4009 : string too big, trailing chars
                        truncated

This is expected behavior. The maximum length of a string literal
under C 5.10 is 512 bytes, including the terminating null character.
This is documented on Page 280 of the "Microsoft C 5.10 Optimizing
Compiler User's Guide". In C 6.00, this limit was increased to 2048
bytes. Lastly, in QuickC 2.00 and 2.50 there is no explicit limit on
the length of string literals. This is documented on Page 266 of the
"Microsoft QuickC 2.00 Compiler Toolkit" manual.

The limit on the size of a string literal under QuickC 2.00 is
dependent on available memory. When there is not enough space, the
compiler gives the following error message:

   filename.c(line #) : fatal error C1059 : out of near heap space

This means that the compiler ran out of room in the near heap for
storing the string literal. In this case, store the string literal in
a file and read it into a character array at run time.

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.

Copyright Microsoft Corporation 1986-2002.