[PATCH] TraceWriterQEMU.cc: Initialize header._pad

Joel Sherrill joel at rtems.org
Wed Sep 1 21:27:03 UTC 2021


On Wed, Sep 1, 2021 at 3:13 PM Gedare Bloom <gedare at rtems.org> wrote:
>
> ok

And stupidly necessary to avoid having uninitialized fields spotted by
static analysis. :(

--joel
>
> On Wed, Sep 1, 2021 at 12:52 PM Ryan Long <ryan.long at oarcorp.com> wrote:
> >
> > CID 1506204: Uninitialized scalar variable
> >
> > Closes #4488
> > ---
> >  tester/covoar/TraceWriterQEMU.cc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tester/covoar/TraceWriterQEMU.cc b/tester/covoar/TraceWriterQEMU.cc
> > index c417745..cc849b6 100644
> > --- a/tester/covoar/TraceWriterQEMU.cc
> > +++ b/tester/covoar/TraceWriterQEMU.cc
> > @@ -113,6 +113,7 @@ namespace Trace {
> >      header.big_endian = false;
> >      header.machine[0] = 0; // XXX ??
> >      header.machine[1] = 0; // XXX ??
> > +    header._pad = 0;
> >      status = ::fwrite( &header, sizeof(trace_header), 1, traceFile );
> >      if (status != 1) {
> >        std::cerr << "Unable to write header to " << file << std::endl;
> > --
> > 1.8.3.1
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list