Add dhex_dump() and DHEXDUMP() to format and print data in hexadecimal

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
I do not like

cflags-remove-tee_core_trace.c-y := -Wmissing-format-attribute



On 22 October 2014 15:06, Jérôme Forissier <notifications@github.com> wrote:

> In core/arch/arm32/kernel/tee_core_trace.c:
>
> > @@ -218,3 +219,67 @@ void _trace_syscall(int num)
> >  }
> >  #endif
> >  #endif
> > +
> > +struct strbuf {
> > +	char buf[MAX_PRINT_SIZE];
> > +	char *ptr;
> > +};
> > +
> > +static int append(struct strbuf *sbuf, const char *fmt, ...) __PRINTFLIKE(2, 3);
>
> OK for the __printf macro. The forward declaration is needed due to
> -Wmissing-format-attribute which causes:
> core/arch/arm32/kernel/tee_core_trace.c: In function ‘append’:
> core/arch/arm32/kernel/tee_core_trace.c:239:2: error: function might be
> possible candidate for ‘gnu_printf’ format attribute
> [-Werror=suggest-attribute=format]
> len = vsnprintf(sbuf->ptr, left, fmt, ap);
> ^
> core/arch/arm32/kernel/tee_core_trace.c:239:2: error: function might be
> possible candidate for ‘gnu_printf’ format attribute
> [-Werror=suggest-attribute=format]
>
> Another option is:
> cflags-remove-tee_core_trace.c-y := -Wmissing-format-attribute
> Which one do you like better?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/OP-TEE/optee_os/pull/84/files#r19211541>.
>