summaryrefslogtreecommitdiff
path: root/plat/common
diff options
context:
space:
mode:
authorDan Handley <dan.handley@arm.com>2018-02-27 13:00:43 +0000
committerDan Handley <dan.handley@arm.com>2018-03-01 16:14:29 +0000
commit97924e4521dbc1002f7b13302fd350c00da36b27 (patch)
treed904ee0aa45c04957361862bab6fa95fd8992204 /plat/common
parent4504ab2bc2c9a3c6db0f92e4a34fc6095766885b (diff)
Suppress spurious deprecated declaration warnings
Some generic compatibility functions emit deprecated declaration warnings even when platforms do not use the deprecated functions directly. This can be confusing. Suppress these warnings by using: `#pragma GCC diagnostic ignored "-Wdeprecated-declarations"` Also emit a runtime warning if the weak plat/common implemntation of plat_get_syscnt_freq2() is used, as this implies the platform has not migrated from plat_get_syscnt_freq(). The deprecated declaration warnings only help detect when platforms are calling deprecated functions, not when they are defining deprecated functions. Fixes ARM-software/tf-issues#550 Change-Id: Id14a92279c2634c1e76db8ef210da8affdbb2a5d Signed-off-by: Dan Handley <dan.handley@arm.com>
Diffstat (limited to 'plat/common')
-rw-r--r--plat/common/aarch64/plat_common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c
index 080d3569..ddd29f29 100644
--- a/plat/common/aarch64/plat_common.c
+++ b/plat/common/aarch64/plat_common.c
@@ -65,7 +65,15 @@ unsigned int platform_core_pos_helper(unsigned long mpidr)
#if !ERROR_DEPRECATED
unsigned int plat_get_syscnt_freq2(void)
{
+ WARN("plat_get_syscnt_freq() is deprecated\n");
+ WARN("Please define plat_get_syscnt_freq2()\n");
+ /*
+ * Suppress deprecated declaration warning in compatibility function
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
unsigned long long freq = plat_get_syscnt_freq();
+#pragma GCC diagnostic pop
assert(freq >> 32 == 0);