description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Warning C28138 |
Warning C28138 |
11/04/2016 |
|
|
d8c455db-1fa0-426c-9846-545f1dfe57bd |
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 shouldn't assume a constant hardware address.