Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 47936dd7 authored by Ken Chen's avatar Ken Chen
Browse files

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
parent 1dc98ce0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment