Re: Bug in SosMan's getline_test
- From: Friar Tuck <nospam@xxxxxxxxxxx>
- Date: Wed, 12 Sep 2007 19:59:32 +0200 (CEST)
On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
Friar Tuck <nospam@xxxxxxxxxxx> writes:
I believe I have found a bug in Dr Sosman's getline_test program, which
is one of the official newsgroup programs.
There is no such thing as an "official newsgroup program", at
least not in comp.lang.c
Well, it's listed on the group website, so I'd say that's official.
(gdb) bt
#0 0x4008febf in getdelim () from /lib/tls/libc.so.6
#1 0x4008d844 in getline () from /lib/tls/libc.so.6
#2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
getline_test.c:44
#3 0x0804891d in main () at getline_test.c:103
(gdb) f 2
#2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
getline_test.c:44
44 buff = getline(file);
It seems very unlikely that Eric would have written his code to
call into the "getline" function in the GNU C library, which is
what this backtrace is showing. I think that you did not compile
and link the test program correctly.
GNU lib'c getline and Eric's getline evidently have different
interfaces, judging from the line of source code above.
I don't believe there's a standard library function called getline. If
there is, wouldn't it be better if Dr Sosman's version either had a
different name, or followed the same interface?
.
- Follow-Ups:
- Re: Bug in SosMan's getline_test
- From: CBFalconer
- Re: Bug in SosMan's getline_test
- From: pete
- Re: Bug in SosMan's getline_test
- From: Mark McIntyre
- Re: Bug in SosMan's getline_test
- From: user923005
- Re: Bug in SosMan's getline_test
- References:
- Bug in SosMan's getline_test
- From: Friar Tuck
- Re: Bug in SosMan's getline_test
- From: Ben Pfaff
- Bug in SosMan's getline_test
- Prev by Date: Assignment without using the C library
- Next by Date: Re: Assignment without using the C library
- Previous by thread: Re: Bug in SosMan's getline_test
- Next by thread: Re: Bug in SosMan's getline_test
- Index(es):
Relevant Pages
|