Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 765 Bytes

28650-generic-value-is-not-treated-as-failure.md

File metadata and controls

19 lines (12 loc) · 765 Bytes
title description ms.date f1_keywords
C28650 Warning
The type for which 0 is being used does not treat it as failure case.
04/20/2017
C28650

C28650

warning C28650: The type for which !0 is being used does not treat it as failure case.

Returning a status value such as !TRUE is not the same as returning a status value that indicates failure.

Certain data types such as NTSTATUS and HRESULT have associated macros that classify values of these types into SUCCESS or FAILURE. These macros check the most significant bit of the returned value or values to determine this. Thus, 0 and 1 are both classified as SUCCESS values.

The proper way to fix this warning is to return a proper error code instead of a generic value such as -1.