KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q43535: ‘strerror’ Example in QuickC Manual May Yield Error

Article: Q43535
Product(s): See article
Version(s): 2.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | docerr | mspl13_c
Last Modified: 2-MAY-1989

The 'strerror' example given at the top of Page 582 of the "Microsoft
QuickC Run-Time Library Reference" may yield the following error:

   error C2086: 'errno' : redefinition

Two conditions are required to produce this error:

1. Compile for the compact- or large-memory model (/AC or /AL).

2. Compile without ANSI compatibility enforced (no /Za).

This error occurs because, under the above conditions, the external
reference has an implied 'far cdecl' and contradicts the external
reference in the include file ERRNO.H, as follows:

   extern int errno;

The external reference in the include file ERRNO.H is as follows:

   extern int near cdecl errno;

To correct this example, remove the following line:

   extern int errno;

This line is not necessary in any case because the external reference
to errno has already been made in ERRNO.H.

Only QuickC Version 2.00 will produce the above error as it is the
first Microsoft compiler to declare errno to be external in the
include file ERRNO.H.

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.