KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q66777: Formal Parameter Cannot Be Based on Previous Formal Parameter

Article: Q66777
Product(s): See article
Version(s): 6.00 6.00a | 6.00 6.00a
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | S_QUICKC buglist6.00 buglist6.00a | mspl13_c
Last Modified: 26-NOV-1990

Based pointers and variables are introduced in Microsoft C version
6.00. One limitation of based addressing is that a formal parameter to
a function cannot be based on a previous formal parameter to the same
function. For example, the compiler will generate an error for the
following function definition, which has two formal parameters with
the second parameter based on the first:

   void foo( _segment myseg, int _based(myseg) *bptr )
   {
   }

The first parameter (myseg) is of type segment, while the second is a
based pointer to an integer (bptr) that is based on the myseg. If
these same variable declarations are not part of a formal parameter
list, they will compile without problem, but the above function will
generate the following compiler error for the based variable:

   error C2065: 'myseg' : undefined

Microsoft has confirmed this to be a problem in C versions 6.00 and
6.00a and QuickC versions 2.50 and 2.51 (buglist2.50 and buglist2.51).
We are researching this problem and will post new information here as
it becomes available.

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.