From 45cb85f8c06351157db0f71b9fa67c412513811c Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 21 Dec 2018 14:52:47 -0800 Subject: Suppress null-dereference warning It is unclear whether author intentionally meant to cause segfault here. While waiting for the author to explain/fix the code, suppress the warning to unblock enabling the warning globally. Test: m checkbuild Bug: 121390225 Change-Id: Iad03842833cfdc243404a32f6b31d161387c3890 --- keymaster/3.0/vts/functional/keymaster_tags.h | 3 +++ keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'keymaster') diff --git a/keymaster/3.0/vts/functional/keymaster_tags.h b/keymaster/3.0/vts/functional/keymaster_tags.h index f241ef160..8544bf7dd 100644 --- a/keymaster/3.0/vts/functional/keymaster_tags.h +++ b/keymaster/3.0/vts/functional/keymaster_tags.h @@ -274,7 +274,10 @@ inline KeyParameter Authorization(TypedTag ttag, Args&&... args) */ template class NullOr { template struct reference_initializer { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnull-dereference" static T&& init() { return *static_cast*>(nullptr); } +#pragma GCC diagnostic pop }; template struct pointer_initializer { static T init() { return nullptr; } diff --git a/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h b/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h index 61c444c16..97dab6821 100644 --- a/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h +++ b/keymaster/4.0/support/include/keymasterV4_0/keymaster_tags.h @@ -282,7 +282,10 @@ template class NullOr { template struct reference_initializer { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnull-dereference" static T&& init() { return *static_cast*>(nullptr); } +#pragma GCC diagnostic pop }; template struct pointer_initializer { -- cgit v1.2.3