right. Thanks for the fixing. CAI Qian wrote: > From: Yi Xu <[email protected]> > Subject: [LTP] [PATCH] compiling errors fixing > Date: Wed, 15 Apr 2009 16:24:21 +0200 > >> Signed-off-by: Yi Xu <[email protected]> > > NACK. I can't see there is any error, but compilation warnings, > > gcc -g -O2 -I../../../../../include -Wall aio01.c -L../../../../../lib > -lltp -o aio01 > aio01.c: In function ‘main': > aio01.c:430: warning: control reaches end of non-void function > > In both of your patches, > > tst_brkm(TCONF, tst_exit, "libaio missing"); > + return ; > > return() is never called, because tst_brkm will call tst_exit() anyway. > > /* > * tst_brkm() - Interface to tst_brk(), with no filename. > */ > void > tst_brkm(int ttype, void (*func)(), char *arg_fmt, ...) > { > ... > /* > * Call tst_brk with a null filename argument. > */ > tst_brk(ttype, NULL, func, tmesg); > } /* tst_brkm() */ > > > /* > * tst_brk() - Fail or break current test case, and break the remaining > * tests cases. > */ > void > tst_brk(int ttype, char *fname, void (*func)(), char *arg_fmt, ...) > { > ... > /* > * 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(); > } > > return; > } /* tst_brk() */ > > In order to fix the warning, we can do, > > --- testcases/kernel/io/aio/aio01/aio01.c.orig 2009-04-16 > 00:22:50.000000000 +0800 > +++ testcases/kernel/io/aio/aio01/aio01.c 2009-04-16 00:24:50.000000000 > +0800 > @@ -426,7 +426,8 @@ > > int main(void) > { > - tst_brkm(TCONF, tst_exit, "libaio missing"); > + tst_resm(TCONF, "libaio missing"); > + tst_exit(); > } > > #endif > > which is probably less confusing. Since tst_exit() has a value > "noreturn", GCC will not throw the warnings. > > extern void tst_exit() attribute_noreturn; > > CAI Qian > >> -- >> Yi Xu [email protected] >> SUSE LINUX Products GmbH R&D-OPS-QA >> Maxfeldstr. 5 +49 (0)911-74053 - 607 >> D-90409 Nuernberg http://www.suse.de >> >> SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) >
-- Yi Xu [email protected] SUSE LINUX Products GmbH R&D-OPS-QA Maxfeldstr. 5 +49 (0)911-74053 - 607 D-90409 Nuernberg http://www.suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
