[must-check-caller-address] finds the calls to get_caller_address and warns the user about it.
Ideally, this rule should NOT emit any warning if the user checks the return value. E.g.:
let (address) = get_caller_address()
if address == 0: # returned values is compared to 0
return () # Could be any other code
end
The above code should NOT emit a warning, as the return value of get_valler_address is checked against 0.
A second example of code that should not emit a warning would be the usage of assert_not_zero:
let (address) = get_caller_address()
assert_not_zero(address)
Indeed, address will be compared (asserted) to 0.
An example of code that SHOULD emit a warning would be:
let (address) = get_caller_address()
call_contract(contract_address=address, ...)
Indeed, the return value is NOT checked against 0.