bugGNU Octave - Bugs: bug #45752, strread causes "concatenation...

 
 

bug #45752: strread causes "concatenation of different character string types" warning

Submitted by:  Lachlan Andrew <lachlan>
Submitted on:  Fri 14 Aug 2015 02:44:33 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: InvalidAssigned to: None
Originator Name: LachlanOpen/Closed: Closed
Release: 4.0.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 15 Aug 2015 08:40:10 AM UTC, comment #3:

Took a bit of searching and weeding, but here it is:

http://octave.1599824.n4.nabble.com/Release-goals-for-3-6-tt3711420.html#a3719055

Just do not expect it to apply cleanly, the patch is 4 years old and several if not all of the affected code has changed significantly during that time.

The thread and references in it give a fine impression of the issues involved.

I'm very much in favor of a binary textscan; I'd like to help but my C++ competence is quite limited. But please keep me informed.

My own idea was to start off with csv2cell() in the io package - it already has the basics and I have done quite a bit of experimenting with it. I even have done some work towards it. Besides, debugging an isolated .oct file is easier than debugging core Octave code.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 15 Aug 2015 12:03:31 AM UTC, comment #2:

Thanks Philip.

One thing I was thinking of doing is rewriting strread with the "common" features (i.e., those that I use :) implemented in C, and the less common cases handled as they are.

Do you know where I can get JWE's skeleton?

Thanks again,
Lachlan

Lachlan Andrew <lachlan>
Project Member
Fri 14 Aug 2015 07:41:36 AM UTC, comment #1:

Running:

so the code 'warning ("error")' screws up somewhere.

The code in strread.m itself (L.393) is here:
and further debugging using your strread command line:

... I see no coding errors or runtime errors that could validly provoke the warning or even error messages.
Looking at the next series of messages above, it is much more probable that the simple code 'warning ("error")' has some unintended and unexpected consequences - see your other report for bug #45753.

As to your strread.m speed complaint:
We all wait for a binary textscan() as replacement for strread.m. Some years ago JWE supplied a skeleton, but that is all that has come up. If you want to speed up strread.m while keeping all its user options (required as backend for current textscan.m), well, good luck with it.

I'm closing this report with "invalid" and refer to bug #45753.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 14 Aug 2015 02:44:33 AM UTC, original submission:

Running the code
produces the error: "error: concatenation of different character string types may have unintended consequences".

The warning is normally suppressed, and so I didn't expect to get this error.

I want to debug Matlab code that produces a warning on Octave but an error on Matlab, which is why I turned warnings into errors. However, the strread warning prevented me reaching the troublesome code.

The work-around is clear (only turn a specific warning into an error), but I would like to fix the bug. I see two options:

1. Make 'warning("error")' only convert warnings to errors if the warning is not suppressed at the time the command is issued. It is easy to write 'warning("error", "all")' if that is desired. This seems to obey the principle of least surprise.

2. Fix the code in strread (and possibly elsewhere) to avoid harmless warnings. This seems cleaner, but adds to code bloat, and takes a slight performance hit -- strread is already too slow IMHO.

I prefer option 1, but want input before writing the patch.

A related issue: it is not clear how to undo the effect of 'warning("error")'. I had to quit Octave and restart. That is a bug in the documentation.

Lachlan Andrew <lachlan>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lachlan (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 14 Aug 2015 07:41:36 AM UTCphilipnienhuisStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1