PRB: C4040: "Near/far/huge Ignored" WarningLast reviewed: July 17, 1997Article ID: Q23978 |
6.00 6.00a 6.00ax 7.00 | 6.00 6.00a | 1.00 1.50
MS-DOS | OS/2 | WINDOWSkbtool kbprb The information in this article applies to:
SYMPTOMSAn attempt to declare far data in an application compiled with the small memory model fails and the compiler generates
Warning C4040: near/far/huge ignored CAUSEAn application compiled in the small memory model can declare far data. The warning indicates that the "far" descriptor is incorrect or unnecessary in the context in which it is used.
RESOLUTIONModify the source code to define far or huge arrays outside a function or as a static value in a function.
MORE INFORMATIONThis warning also occurs when an application declares a "char * far pvar" pointer in the body of a function. This definition defines a pointer to data (either near or far, depending on the memory model used) and places the pointer into a data segment other than the default data segment. This declaration works correctly as a global definition or as a static definition in the body of the function. Note that "char * far pvar" is different from "char far *pvar" which declares a pointer to far data. The latter declaration creates a pointer that can point to data outside the default data segment while the pointer itself resides in the default data segment. The latter declaration is perfectly acceptable in the body of a function compiled in the small memory model.
|
Additional reference words: 1.00 1.50 6.00 6.00a 6.00ax 7.00 8.00 8.00c
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |