[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45752] strread causes "concatenation of diffe
From: |
Lachlan Andrew |
Subject: |
[Octave-bug-tracker] [bug #45752] strread causes "concatenation of different character string types" warning |
Date: |
Fri, 14 Aug 2015 02:44:34 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?45752>
Summary: strread causes "concatenation of different character
string types" warning
Project: GNU Octave
Submitted by: lachlan
Submitted on: Fri 14 Aug 2015 02:44:33 AM GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Lachlan
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.0.0
Operating System: GNU/Linux
_______________________________________________________
Details:
Running the code
warning("error")
strread ('1,1', '%d', 'delimiter', ',')
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.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45752>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #45752] strread causes "concatenation of different character string types" warning,
Lachlan Andrew <=