On Wed, 2008-08-13 at 17:18 +0800, Jin Bing Guo wrote:
> When compiling hackbench.c , I got the warning message:
> ---------------
> $ ./testcases/kernel/sched/cfs-scheduler$ make
> cc -I../../../../include -Wall hackbench.c -L../../../../lib -lltp
> -lpthread -o hackbench
> hackbench.c: In function ‘main’:
> hackbench.c:350: warning: control reaches end of non-void function
> --------------
> 
> That means the hackbench would return a random number. I tested it on
> some different versions of GCC and got the non-zero return value.
> --------------

> A simple patch can avoid this problem.
> 
> Signed-off-by: Jin Bing Guo <[EMAIL PROTECTED]>
> ----------
> ---
> ltp-full-20080731.orig/testcases/kernel/sched/cfs-scheduler/hackbench.c 
> 2008-07-21 06:18:06.000000000 -0500
> +++ ltp-full-20080731/testcases/kernel/sched/cfs-scheduler/hackbench.c
> 2008-08-13 03:40:01.000000000 -0500
> @@ -347,4 +347,7 @@ int main(int argc, char *argv[])
> 
> /* Print time... */
> timersub(&stop, &start, &diff);
> + printf("Time: %lu.%03lu\n", diff.tv_sec, diff.tv_usec/1000);
> + exit(0);
> + 
> }
> 

Yes, it indeed solves the issue. Please see:

========================
Pre-Patch
========================
# make
cc -I../../../../include -Wall    hackbench.c  -L../../../../lib -lltp
-lpthread -o hackbench
hackbench.c: In function ‘main’:
hackbench.c:350: warning: control reaches end of non-void function

========================
Post-Patch
========================
# make
cc -I../../../../include -Wall    hackbench.c  -L../../../../lib -lltp
-lpthread -o hackbench

# ./hackbench 
Running with 10*40 (== 400) tasks.
Time: 5.551
# echo $?
0

Thanks for the fix. The same has been merged. The only issue is the way
LOTUS NOTES kills you patches. I was not able to apply it as it is.
Since, it was a trivial patch, i was able to apply my copy & paste.

Please send patches as file attachments, if you are sending from Lotus
Notes.

Regards--
Subrata

> 
> 
> Best regards!
> 
> Jin Bing Guo 郭晋兵
> 
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________ Ltp-list mailing list 
> [email protected] 
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to