lkml.org 
[lkml]   [2012]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/9] virtio_mmio: Cast &resources[1].start to ‘unsigned int *’ to rid compiler warning
From
Date
On Mon, 2012-11-05 at 08:21 +0000, Lee Jones wrote:
> > > processed = sscanf(str, "@%lli:%u%n:%d%n",
> > > - &base, &resources[1].start, &consumed,
> > > + &base, (unsigned int *)&resources[1].start, &consumed,
> > > &vm_cmdline_id, &consumed);
> >
> > This suppresses a valid warning, leaving our code no less wrong than
> > before. But now it's silently wrong!
> >
> > Do you want to try again?
>
> For sure I'll try again.
>
> How does `s/%u/%p/` suit?

sscanf doesn't do "%p"... The only reasonable way of fixing this is a
intermediate local variable - will post a patch in a second.

Thanks for spotting this!

Paweł


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-11-05 14:42    [W:1.141 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site