summaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2015-02-05 15:42:31 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2015-03-06 13:07:43 +0000
commitdad25049cec0e30ca9771e435064ebf853d97bba (patch)
tree9c4a067d102cb11939d662c93c521b897ba8cbf7 /bl31
parent5930eadbe5d8d4c3f15fd910476f72cd5bf86f44 (diff)
Enable type-checking of arguments passed to printf() et al.
This patch modifies the declarations of the functions printf() et al. and adds the right GCC attribute to request the compiler to check the type of the arguments passed to these functions against the given format string. This will ensure that the compiler outputs warning messages like the following whenever it detects an inconsistency: file.c:42: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’ It also fixes the type mismatch inconsistencies that it revealed across the code base. NOTE: THIS PATCH MAY FORCE PLATFORM PORTS OR SP/SPDS THAT USE THE PRINTF FAMILY OF FUNCTIONS TO FIX ANY TYPE MISMATCH INCONSISTENCIES. Change-Id: If36bb54ec7d6dd2cb4791d89b02a24ac13fd2df6
Diffstat (limited to 'bl31')
-rw-r--r--bl31/runtime_svc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bl31/runtime_svc.c b/bl31/runtime_svc.c
index c33748f9..fd64c824 100644
--- a/bl31/runtime_svc.c
+++ b/bl31/runtime_svc.c
@@ -103,8 +103,8 @@ void runtime_svc_init(void)
*/
rc = validate_rt_svc_desc(&rt_svc_descs[index]);
if (rc) {
- ERROR("Invalid runtime service descriptor 0x%x (%s)\n",
- &rt_svc_descs[index],
+ ERROR("Invalid runtime service descriptor 0x%lx (%s)\n",
+ (uintptr_t) &rt_svc_descs[index],
rt_svc_descs[index].name);
goto error;
}