Fix -Wnullable-to-nonnull-conversion errors
Aosp/2522835 adds _Nullable/_Nonnull annotations which causes build break in DNS resolver module and tests. This commit tries to: 1. Check if a nullable variable is non-null before passing it to a function with a non-null parameter annotation. This is necessary because passing null pointers to memcpy(), strlen(), strdup(), etc is undefined behavior. 2. Add a hacky way to avoid -Wnullable-to-nonnull-conversion errors. Compiler is not smart enough to know if a variable is guaranteed non-null from context. Bug: 278513807 Test: presubmit Change-Id: I2bcf887e31a2d9716c1da75431280ec29d4e5c34
Loading
Please register or sign in to comment