octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45687] fread does not allow different ARCH wh


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #45687] fread does not allow different ARCH when file fopen'd with ARCH
Date: Fri, 07 Aug 2015 23:01:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.1.0

Update of bug #45687 (project octave):

                  Status:               Need Info => Confirmed              
                 Release:                   4.0.0 => dev                    
        Operating System:       Microsoft Windows => Any                    
                 Summary: fread does not support ARCH 'ieee-le' for double on
64bits PC => fread does not allow different ARCH when file fopen'd with ARCH

    _______________________________________________________

Follow-up Comment #6:

Ok, I'm able to reproduce on Linux. But I have no idea if this is a valid
situation, or whether we just want to have a better error handler for this
condition. When the file is opened with ARCH = "native", you can choose the
same or different ARCH when doing fread. But if fopen is called with ARCH !=
"native", then a different ARCH becomes an error in fread.


octave:1> x = pi;
octave:2> fid = fopen ("foo.dat", "w"); fwrite (fid, x, "double"); fclose
(fid);
octave:3> fid = fopen ("foo.dat", "r", "b"); y = fread (fid, 1, "double");
fclose (fid);
octave:4> y
y =   3.2074e-192
octave:5> fid = fopen ("foo.dat", "r", "b"); y = fread (fid, 1, "double", 0,
"native"); fclose (fid);
error: fread: impossible state reached in file
'../liboctave/util/data-conv.cc' at line 702
octave:5> fid = fopen ("foo.dat", "r", "b"); y = fread (fid, 1, "double", 0,
"ieee-le"); fclose (fid);
error: fread: impossible state reached in file
'../liboctave/util/data-conv.cc' at line 702



The ARCH values "b", "l", and "n" are undocumented synonyms for "ieee-be",
"ieee-le", and "native", respectively.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45687>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]