On Tue, 22 Jun 2010 04:30:12 +1000 (EST)
Bruce Evans <b...@optusnet.com.au> wrote:

> On Mon, 21 Jun 2010, Alexander Kabaev wrote:
> 
> > On Tue, 22 Jun 2010 03:22:40 +1000 (EST)
> > Bruce Evans <b...@optusnet.com.au> wrote:
> >
<SKIP>
> >
> > DTrace _does_ try to unput EOF though and apparently gets away with
> > it on Solaris, so while yor version is correct, it is also useless.
> 
> Do you mean that it tries to unput EOF as an int (not obtained from a
> char), and that that must fail and not unput ((unsigned char)EOF)?
> Then the current version is still broken on platforms with chars
> signed, since when it tries to unput a char with value EOF, that will
> fail and not unput ((unsigned char)<char's value>).

Correct, but chances of valid DTrace script having 0xff character in
them is pretty much nonexistent, so I let that slide rather than
pushing more changes into externally maintained code. To be absolutely
correct, I think, we need to declare unput() as inline/static taking int
argument and make sure that we invoke it as unput((unsigned char)*q)
every time q is declared as char *.

-- 
Alexander Kabaev

Attachment: signature.asc
Description: PGP signature

Reply via email to