From ripley@stats.ox.ac.uk  Fri Dec 22 16:53:24 2000
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Fri, 22 Dec 2000 17:53:24 +0100 (MET)
Subject: [Rd] (HP-UX) scan: last line gets duplicated (PR#790)
Message-ID: <200012221653.RAA13197@pubhealth.ku.dk>

On Fri, 22 Dec 2000 kleiweg@let.rug.nl wrote:

> > On Fri, 22 Dec 2000 kleiweg@let.rug.nl wrote:
> 
> > > The last line gets duplicated when a file is read like this:
> > > 
> > >     a <- scan(file=filename, what="", sep="\n",
> > >                     strip.white=c(TRUE), quiet=TRUE)
> 
> > > Version:
> > >  platform = hppa2.0-hp-hpux10.20
> 
> > >  major = 1
> > >  minor = 2.0
> > >  year = 2000
> > >  month = 12
> > >  day = 15
> 
> Prof Brian D Ripley wrote:
> 
> > This bug PR#672, also reported from your institution.
> 
> That would be me. I reported this bug before, for R version
> 1.1.0

It *is* in the BUGS list shipped with 1.2.0, so why send it in again
with no references to the earlier one?

> > It has only been reported from HP-UX, and only from your
> > systems. Could someone there debug it, please?
> 
> I would fix it, if I new how to. Perhaps you can suggest
> something from the warning messages I get.

No, but I do suggest you debug it.  That is, build a debug version and run
it under gdb, and find out why this happens.  Is it just scan?
Does read.table (which uses scan) do it?  Does readLines (which does not)?
Does it happen on all files?  Only on those with CRLF or only LF line
endings?  Only on those with incomplete last lines?

It might be a compiler bug, so perhaps you would like to try compiling
with gcc.


> During compiling I get a lot of warning messages. These are for
> scan.c:
> 
> 	cc -I. -I../../src/include -I../../src/include
>   -I/opt_local/opt/readline/include I/opt_local/opt/tk/include
>   --I/opt_local/opt/tcl/include I/opt_local/opt/jpeg6/include
>   -I/opt_local/opt/png/include I/opt_local/opt/ncurses/include
>   -I/opt_local/opt/zlib/include I/users1/kleiweg/R-1.2.0-source
>   --DHAVE_CONFIG_H D_HPUX_SOURCE +DA1.1 +DS1.1 -Wp,-H16000
>   -I/opt_local/opt/readline/include I/opt_local/opt/tk/include
>   --I/opt_local/opt/tcl/include I/opt_local/opt/jpeg6/include
>   -I/opt_local/opt/png/include I/opt_local/opt/ncurses/include
>   -I/opt_local/opt/zlib/include I/users1/kleiweg/R-1.2.0-source
>   -L/opt_local/opt/readline/lib -L/opt_local/opt/tk/lib
>   -L/opt_local/opt/tcl/lib -L/opt_local/opt/jpeg6/lib
>   -L/opt_local/opt/png/lib -L/opt_local/opt/ncurses/lib
>   -L/opt_local/opt/zlib/lib L/users1/kleiweg/R-1.2.0-source -Aa -c
>   -scan.c -o scan.o

The next are the lines of signed/unsigned char warnings that occur with
more informative messages on my platforms.  You need to look up the
numbers in your manual, as we do not have a manual for your compiler.

> cc: "scan.c", line 65: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 65: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 72: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 72: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 109: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 109: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 300: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 300: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 309: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 309: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 336: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 336: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 350: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 350: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 449: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 449: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 478: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 478: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 858: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 858: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 919: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 919: warning 563: Argument #1 is not the correct type.
> cc: "scan.c", line 957: warning 604: Pointers are not assignment-compatible.
> cc: "scan.c", line 957: warning 563: Argument #1 is not the correct type.


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] (HP-UX) scan: last line gets duplicated (PR#790)
ripley@stats.ox.ac.uk