[PATCH] sandbox: p2sb: Silence compiler warning
Tom Rini
trini at konsulko.com
Mon Feb 10 20:08:29 CET 2020
On Mon, Feb 10, 2020 at 12:03:26PM -0700, Simon Glass wrote:
> Hi Stephen.
>
> On Mon, 10 Feb 2020 at 11:28, Stephen Warren <swarren at wwwdotorg.org> wrote:
> >
> > On 2/8/20 8:21 AM, Bin Meng wrote:
> > > On Sat, Feb 8, 2020 at 10:53 PM Simon Glass <sjg at chromium.org> wrote:
> > >>
> > >> Some compilers produce a warning about 'child' being used before init.
> > >> Silence this by setting to NULL at the start.
> > >
> > > Should be a compiler bug I think. Which compiler has such issue?
> >
> > gcc 7.2.1 (Linaro build x86 -> ARM cross-compiler)
> >
> > I don't believe this is a compiler bug.
>
> Well it is 'fixed' in 7.3.
>
> >
> > For the compiler *not* to emit this warning, it would have to apply
> > cross-function data flow analysis, which isn't something guaranteed by
> > the C standard IIRC, since it's a very hard problem in general. So, not
> > a compiler *bug* even if we'd like to see the compiler be smart about
> > these things.
>
> Yes it is hard. I do think it is worth avoiding these problems where
> we can. But in general I build with the latest kernel toolchain. I
> think, sadly, if we really want to solve this problem we may need a
> way to make buildman automatically build with multiple toolchains.
Well, lets see what's going on here a bit more. We're at the point
right now where it's painful that we're on gcc-7.3 for the most part and
can't easily / universally move up to a 9.something.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200210/90743df1/attachment.sig>
More information about the U-Boot
mailing list