public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* %pa format specifier issues
@ 2013-03-06  1:18 Dave Hansen
  2013-03-06  2:19 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Hansen @ 2013-03-06  1:18 UTC (permalink / raw)
  To: Stepan Moskovchenko, Rob Landley, George Spelvin, Andy Shevchenko,
	Stephen Boyd, Andrei Emeltchenko, Ingo Molnar, LKML

I went to go use the shiny new %pa specifier:

void test_printk_pa(void)
{
        phys_addr_t p = 0x1234;
        printk("p: %pa\n", p);
}

but gcc is spewing out warnings at me:

> arch/x86/mm/physaddr.c: In function ‘test_printk_pa’:
> arch/x86/mm/physaddr.c:95:2: warning: format ‘%p’ expects argument of type ‘void *’, but argument 2 has type ‘phys_addr_t’ [-Wformat]

I assume that's because gcc doesn't know about '%pa', and just assumes
it's a plain '%p'.  Should we be turning these warnings off somehow?

Plus when I actually go to run it, vsnprintf() crashes the kernel, which
usually happens if printk()'s format doesn't match the size of its
arguments.

Am I doing something really stupid here?

This is using a 32-bit i386 kernel.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-06  6:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06  1:18 %pa format specifier issues Dave Hansen
2013-03-06  2:19 ` Stephen Boyd
2013-03-06  6:29   ` Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox