[Mesa-dev] [PATCH v2 4/5] main: avoid 'may be used uninitialized' warnings

andrey simiklit asimiklit.work at gmail.com
Tue Mar 5 12:41:00 UTC 2019


Hello,

Could somebody take a look at this old patch?

Thanks,
Andrii.

On Tue, Nov 13, 2018 at 6:41 PM Eric Engestrom <eric.engestrom at intel.com>
wrote:

> On Tuesday, 2018-11-13 14:19:31 +0200, asimiklit.work at gmail.com wrote:
> > From: Andrii Simiklit <andrii.simiklit at globallogic.com>
> >
> > 1. main/texcompress_etc.c:1314:12:
> >     warning: ‘*((void *)&dst+2)’ may be used uninitialized in this
> function
> > 2. main/texcompress_etc.c:1354:12:
> >     warning: ‘*((void *)&dst+2)’ may be used uninitialized in this
> function
> > 3. main/texcompress_etc.c:1293:12:
> >     warning: ‘dst’ may be used uninitialized in this function
> > 4. main/texcompress_etc.c:1335:12:
> >     warning: ‘dst’ may be used uninitialized in this function
> > 5. main/texcompress_etc.c:1460:12:
> >     warning: ‘*((void *)&dst+1)’ may be used uninitialized in this
> function
> >
> > v2: Fixed by adding the unreachable case to the etc2_rgb8_fetch_texel
> >        ( Eric Engestrom <eric.engestrom at intel.com> )
> >     Changes for warning 'pixerrorcolorbest' were removed.
> >
> > Signed-off-by: Andrii Simiklit <andrii.simiklit at globallogic.com>
>
> This is the right way of fixing this code-wise, but I'm not 100% sure we
> can actually guarantee this logic-wise, so I'll let someone else review
> (and push) this patch.
>
> Acked-by: Eric Engestrom <eric.engestrom at intel.com>
>
> > ---
> >  src/mesa/main/texcompress_etc.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/src/mesa/main/texcompress_etc.c
> b/src/mesa/main/texcompress_etc.c
> > index b39ab33d36..f1da4d0f11 100644
> > --- a/src/mesa/main/texcompress_etc.c
> > +++ b/src/mesa/main/texcompress_etc.c
> > @@ -548,6 +548,7 @@ etc2_rgb8_fetch_texel(const struct etc2_block *block,
> >        if (punchthrough_alpha)
> >           dst[3] = 255;
> >     }
> > +   else unreachable("unhandled block mode");
> >  }
> >
> >  static void
> > --
> > 2.17.1
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190305/cb4ca00e/attachment.html>


More information about the mesa-dev mailing list