diff --git a/infer/documentation/issues/UNINITIALIZED_VALUE.md b/infer/documentation/issues/UNINITIALIZED_VALUE.md new file mode 100644 index 000000000..d50d84771 --- /dev/null +++ b/infer/documentation/issues/UNINITIALIZED_VALUE.md @@ -0,0 +1,19 @@ +A value is read before it has been initialized. For example, in C: + +```C +struct coordinates { + int x; + int y; +}; + +void foo() { + struct coordinates c; + c.x = 42; + c.y++; // uninitialized value c.y! + + int z; + if (z == 0) { // uninitialized value z! + // something + } +} +``` diff --git a/infer/src/base/IssueType.ml b/infer/src/base/IssueType.ml index 89726737e..bc15677c4 100644 --- a/infer/src/base/IssueType.ml +++ b/infer/src/base/IssueType.ml @@ -927,7 +927,10 @@ let _unavailable_api_in_supported_ios_sdk = ~user_documentation:[%blob "../../documentation/issues/UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK.md"] -let uninitialized_value = register_from_string ~id:"UNINITIALIZED_VALUE" Error Uninit +let uninitialized_value = + register_from_string ~id:"UNINITIALIZED_VALUE" Error Uninit + ~user_documentation:[%blob "../../documentation/issues/UNINITIALIZED_VALUE.md"] + let unreachable_code_after = register_from_string ~id:"UNREACHABLE_CODE" Error BufferOverrunChecker