From: Cyril Hrubis <[email protected]>
Subject: Re: [LTP] [[email protected]: Re: [PATCH] fix missing return in several
files.]
Date: Mon, 1 Jun 2009 21:36:22 +0200
> Hi,
> today I was digging a bit deeper into this source and find out following:
> tst_exit() is defined as __attribute__ ((noreturn)). That's hint for gcc
> compiler that this function never exits, so far it's good.
>
> Problem in these two tests is that they pass tst_exit as cleanup function to
> tst_brkm(). But function tst_brkm() is not defined as __attribute__
> ((noreturn)). So we have function that never retuns and we have the same
> problem again. The fix is trivial, instead of passing tst_exit() as cleanup
> function just call it directly.
>
Well, in this case, tst_brkm() looks like unnecessary here.
/*
* If no cleanup function was specified, just return to the caller.
* Otherwise call the specified function. If specified function
* returns, call tst_exit().
*/
if ( func != NULL ) {
(*func)();
tst_exit();
}
The tst_exit() you just added will not be called anyway.
CAI Qian
> Patch attached.
>
> Signed-off-by: [email protected]
>
> --
> Cyril Hrubis
> [email protected]
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list