Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

C28138

warning C28138: The constant argument should instead be variable

This warning is reported in a function call that expects a variable or a non-constant expression, but the call includes a constant. For information about the function and its parameter, consult the WDK documentation of the function.

For example, in the following code example, the parameter of the READ_PORT_UCHAR macro must be a pointer to the port address, not the address provided as a constant.

The following code example generates this warning message:

READ_PORT_UCHAR(0x80001234);

To correct this warning, use a pointer to the port address.

READ_PORT_UCHAR(PortAddress);

There are a few older devices for which a constant parameter is acceptable with the READ_PORT and WRITE_PORT family of functions. When those devices receive this warning, the warning can be suppressed or ignored. However, any new devices should not assume a constant hardware address.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.