KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q36955: C2086, C2061 on CFLOW.C when Language Extentions Not Enabled

Article: Q36955
Product(s): See article
Version(s): 5.00 5.10 | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 12-DEC-1988

Compiling the sample program CFLOW.C with language extensions disables
results in the following errors:

cflow.c(4) : error C2086: 'size_t' : redefinition
cflow.c(934) : error C2061: syntax error : identifier 'c'

The Microsoft extensions to C can be disabled by compiling with
the option /Za (enforce ANSI compatibility) or, when in QuickC,
clearing the X from the Language Extensions check box in the Compile
dialog box.

The C2086 error occurs because both CFLOW.C and STDIO.H have the following:

typedef unsigned int size_t;

Redefinition of a typedef is a language extension. This information is
stated in the "Microsoft C Optimizing Compiler User's Guide" on Page
100.

The C2061 error occurs on the line

static int near c;

because the keyword "near" is an extension to C, and so is understood
by the compiler to be the simple identifier being defined, leaving the
now-surplus "c" to be flagged as syntactically incorrect. This
information is documented in the user's guide on Page 99.

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.