Re: Bug in SosMan's getline_test



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?

.



Relevant Pages

  • Re: Bug in SosMans getline_test
    ... is one of the official newsgroup programs. ... with somebody else's getline() function. ... portability and an emphasis on ease of use. ... My father was a doctor, and his father was a doctor, and ...
    (comp.lang.c)
  • Re: Bug in SosMans getline_test
    ... is one of the official newsgroup programs. ... Well, it's listed on the group website, so I'd say that's official. ... I don't believe there's a standard library function called getline. ... But there is a GNU version that is very popular among ...
    (comp.lang.c)
  • Re: Bug in SosMans getline_test
    ... is one of the official newsgroup programs. ... Well, it's listed on the group website, so I'd say that's official. ... GNU lib'c getline and Eric's getline evidently have different ... However what Ben said was "GNU libc's getline". ...
    (comp.lang.c)
  • Re: Bug in SosMans getline_test
    ... is one of the official newsgroup programs. ... GNU lib'c getline and Eric's getline evidently have different ... judging from the line of source code above. ...
    (comp.lang.c)