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.
|