Re: Bug in SosMan's getline_test
- From: Friar Tuck <nospam@xxxxxxxxxxx>
- Date: Fri, 14 Sep 2007 01:39:12 +0200 (CEST)
On 12 Sep 2007 at 23:47, pete wrote:
Friar Tuck wrote:
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,
Is he really a doctor?
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.
There is no such thing as "the group website".
Isn't the group website cpac.org? It's in one of the group moderator's
signatures and has lots of C resources. It certainly looks official.
GNU lib'c getline
I don't believe there's a standard library function called getline.
There isn't.
What is your native language?
C (gcc 4.1.3).
Was the final conclusion of this thread that Dr Sosman's function
clashes with a common library funcion and should be renamed?
Actually, looking through that backtrace again is quite interesting:
(gdb) p *file
$1 = {_flags = -72539008,
_IO_read_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats
174 times>...,
_IO_read_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats
174 times>...,
_IO_read_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
<repeats 174 times>...,
_IO_write_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
<repeats 174 times>...,
_IO_write_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
<repeats 174 times>...,
_IO_write_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
<repeats 174 times>...,
_IO_buf_base = 0x40018000 'n' <repeats 25 times>, "\n",
'd' <repeats 174 times>...,
_IO_buf_end = 0x40019000 'b' <repeats 200 times>...,
_IO_save_base = 0x0,
_IO_backup_base = 0x0, _IO_save_end = 0x0, _markers
= 0x0,
_chain = 0x40151460,
_fileno = 6, _flags2 = 0, _old_offset = 0,
_cur_column = 0,
_vtable_offset = 0 '\0',
_shortbuf = "", _lock = 0x804a0a0, _offset =
0, __pad1 =
0x0, __pad2 = 0x804a0ac,
_mode = -1, _unused2 = '\0' <repeats
51 times>}
(gdb)
Does anyone know what all these fields in the FILE * structure do? It
could be useful to be able to pick out information directly from a file
pointer. (By the way, it still looks to me like the _flags field has
been corrupted somehow by getline_test.)
.
- Follow-Ups:
- Re: Bug in SosMan's getline_test
- From: pete
- Re: Bug in SosMan's getline_test
- From: Chris Dollin
- Re: Bug in SosMan's getline_test
- From: Keith Thompson
- Re: Bug in SosMan's getline_test
- From: Ben Pfaff
- Re: Bug in SosMan's getline_test
- From: Barry Schwarz
- 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
- Re: Bug in SosMan's getline_test
- From: Friar Tuck
- Re: Bug in SosMan's getline_test
- From: pete
- Bug in SosMan's getline_test
- Prev by Date: Re: Sizes of Integer Types
- Next by Date: typedefing a struct
- Previous by thread: Re: Bug in SosMan's getline_test
- Next by thread: Re: Bug in SosMan's getline_test
- Index(es):
Relevant Pages
|