C28132

warning C28132: Taking the size of pointer

Additional information

This will yield the size of a pointer (4 or 8), not the size of the object pointed to. Dereference the pointer, or if the size of a pointer was intended, use the pointer type or (void *) instead.

The driver is taking the size of a pointer variable, not the size of the value that is pointed to. If the driver needs the size of the pointed-to value, change the code so that it references the value. If the driver actually needs the size of the pointer, take the size of the pointer type (for example, LPSTR, char* or even void*) to clarify that this is the intent.

Example

The following code example elicits this warning.

memset(b, 0, sizeof(b));

The following code example avoids this warning.

memset(b, 0, sizeof(*b));