DOCERR: /GD and /Au Are Incompatible

Last reviewed: July 17, 1997
Article ID: Q85504
7.00 | 1.00 1.50 MS-DOS | WINDOWS kbtool kbdocerr

The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE), included with:

        - Microsoft C/C++ for MS-DOS, versions 7.0
        - Microsoft Visual C++ for Windows, versions 1.0 and 1.5
    

SUMMARY

There is a documentation error relating to the use of Windows entry/exit code optimization switches for Microsoft C/C++ versions 7.0 and 8.0 in the Windows version 3.1 Software Development Kit (SDK) online Programming Tips help file. The help file states the following:

   Use the -Gw compiler switch to generate Windows prolog and epilog
   code for FAR functions under C 6.x. Under C 7.0, optimized
   prolog/epilog code can be generated using the /GD switch. The
   prolog code is not required when a DLL will be used only in
   protected mode. The only restriction is that exported FAR functions
   must explicitly reload DS when called. This code can be generated
   by two methods:

   1. Use the -Au switch on the Microsoft C compiler command line.
      This will generate a load for DS for each FAR function.

   2. Use the _loadds attribute for exported functions as demonstrated
      below:

         BOOL FAR PASCAL _loadds ExportedFunction(VOID)

Item number 1 is incorrect if you are using the /GD option.

MORE INFORMATION

Using /GD and /Au together generates the following error:

   Command line error D2016 :
   /GD and /Au command-line options are incompatible

The /GD switch implies /Aw, and therefore there is a conflict between the /GD and /Au options.

The /GD option along with the /GEf option will force all __far functions to load DS. The /GEf is not needed if all functions that are to be exported use the __export qualifier.

NOTE: The Programming Tips help file shows the __loadds keyword with only one underscore. This still works for backward compatibility; however, for strict ANSI compliance you should use two underscores.


Additional reference words: 1.00 1.50 7.00 8.00 8.00c loadds entry exit
KBCategory: kbtool kbdocerr
KBSubcategory: CLIss
Keywords : kb16bitonly


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: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.