다음을 통해 공유


PREfast Warning 269 (Windows CE 5.0)

Send Feedback

269 - Incorrect order of operations.
Additional Information: Dereference ignored.

This warning indicates that the result of a pointer dereference is being ignored, which raises the question of why the pointer is being dereferenced in the first place.

The compiler correctly optimizes away the gratuitous dereference. However, in some cases this defect can reflect a precedence or logic error.

One common cause for this defect is an expression statement of the form:

*p++;

If the intent of this statement is to increment the pointer p, the dereference operation is unnecessary, and is often caused by cutting and pasting. However, if the intent is to increment the location that p is pointing to, the program will not behave as intended: unary operators group from right to left, so this construct is interpreted as * (p++), rather than (*p)++.

Example

Defective Source

*p++;

Corrected Source

(*p)++;

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.