[LTP] [PATCH 2/4] lib: Redirect to tst_brk_() early

Jan Stancek jstancek@redhat.com
Tue Feb 14 14:36:11 CET 2017


----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 14 February, 2017 2:22:44 PM
> Subject: Re: [LTP] [PATCH 2/4] lib: Redirect to tst_brk_() early
> 
> Hi!
> > > We also had to add a few returns to various places in the test library so
> > > that
> > > we exit corresponding function in a case that tst_brkm() actually
> > > returned.
> > > 
> > > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > 
> > 1/4 and 2/4 look good to me, and match exactly what we discussed.
> > Reply to 3/4 and 4/4 will follow shortly.
> > 
> > Build on RHEL5.6 6.0 and 7.3 passes, but I noticed couple additional
> > warnings:
> > 
> > tst_test.c: In function ???print_result???:
> > tst_test.c:175: warning: ???res??? may be used uninitialized in this
> > function
> 
> What about adding an abort() after the tst_brk() in the switch?

Agreed, if this fails there's something very bad going on.

> 
> > test08.c: In function ???worker???:
> > test08.c:54: warning: control reaches end of non-void function
> 
> That should be fixed easily with return NULL; at the end of the
> function.
> 
> > netstress.c: In function ???server_fn???:
> > netstress.c:539: warning: control reaches end of non-void function
> 
> Dummy return NULL should fix this one as well.
> 
> 
> 
> These fixes should be part of 3/4 that removes the attribute noreturn
> from the tst_brk_().
> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 


More information about the ltp mailing list