[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ud segfault (was: When will the amd64 port be stable?)



ron.l.johnson@cox.net wrote:
>On Sun, 2004-12-12 at 05:18 +0000, Steve McIntyre wrote:
>> 
>> The reason for this becomes clear once you turn on warnings in the
>> compilation:
>> 
>> gcc -DPACKAGE=\"ud\" -DVERSION=\"0.7.1\" -DSTDC_HEADERS=1
>-DHAVE_UNISTD_H=1 -DRETSIGTYPE=void -DHAVE_GETHOSTNAME=1  -I. -I.     
>-g -O2 -Wall -W -c ud.c
>> ud.c: In function `get_kernel_version':
>> ud.c:150: warning: implicit declaration of function `ctime'
>> ud.c:150: warning: format argument is not a pointer (arg 3)
>> 
>> ctime is returning a pointer rather than an int. Simply adding
>> "#include <time.h>" to the top of the ud.c source file fixes this
>> bug. Prototypes are there for a reason!
>> 
>> Turning on warnings also highlights other silly coding bugs, but I'll
>> leave those for other people.
>
>Hey, let's start a flame war about the unnecessary use of C in
>non-core functionality!!!

I agree with you, actually. ud is a perfect example of an app where C
is very much the Wrong Thing. From scanning the source, I'd replace it
with a small shell/perl/python script running out cron if I cared
enough for what it does...

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
We don't need no education.
We don't need no thought control.



Reply to: