diff --git a/configure.ac b/configure.ac index 0d7f6ba1fe..55f431b21d 100644 --- a/configure.ac +++ b/configure.ac @@ -1536,7 +1536,7 @@ fi OCTAVE_CHECK_LIB(bz2, BZIP2, [BZIP2 library not found. Octave will not be able to compress or decompress bzip2 files.], - [bzlib.h], [BZ2_bzCompressInit]) + [bzlib.h], [BZ2_bzCompressInit], [], [], [], [bzip2]) ### Check for HDF5 library. @@ -1654,7 +1654,7 @@ CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" OCTAVE_CHECK_LIB(curl, cURL, [cURL library not found. The ftp objects, urlread, and urlwrite functions will be disabled.], - [curl/curl.h], [curl_easy_escape]) + [curl/curl.h], [curl_easy_escape], [], [], [], [libcurl]) if test -n "$CURL_LIBS"; then ## Additional check on cURL library that was found AC_CACHE_CHECK([for CURLOPT_DIRLISTONLY in curl/curl.h], diff --git a/doc/interpreter/genpropdoc.m b/doc/interpreter/genpropdoc.m index 1d938af695..5e72a94103 100644 --- a/doc/interpreter/genpropdoc.m +++ b/doc/interpreter/genpropdoc.m @@ -876,7 +876,7 @@ element defines a pixel with the element (1,1) representing the \ case "clim" s.doc = "Define limits for the color axis of __objname__ \ -children that have the @qcode{cdata} property. \ +children that have the @code{cdata} property. \ __modemsg__"; s.valid = valid_2elvec; s.category = "Color and Transparency"; @@ -885,7 +885,7 @@ element defines a pixel with the element (1,1) representing the \ s.doc = "Current state of the color limit mode, either \ manually set by the \ @ref{XREFaxesclim, , @w{@qcode{\"clim\"} property}} or automatically set by \ -Octave to the minimum and maximum @qcode{cdata} values of __objname__'s \ +Octave to the minimum and maximum @code{cdata} values of __objname__'s \ children."; s.category = "Color and Transparency"; diff --git a/doc/interpreter/plot.txi b/doc/interpreter/plot.txi index c582cd3d8b..0bb4f7b816 100644 --- a/doc/interpreter/plot.txi +++ b/doc/interpreter/plot.txi @@ -747,7 +747,7 @@ figure window, call the @code{close} function. @subsection Use of the "interpreter" Property @code{text} (such as titles, labels, legend item) and @code{axes} objects -feature an @ref{XREFtextinterpreter,,@qcode{"interpreter}} and a +feature an @ref{XREFtextinterpreter,,@qcode{"interpreter"}} and a @ref{XREFaxesticklabelinterpreter,,@qcode{"ticklabelinterpreter"}} property respectively. It determines the manner in which special control sequences in the text are rendered. diff --git a/etc/NEWS.9.md b/etc/NEWS.9.md index 66fb55022a..b670359a45 100644 --- a/etc/NEWS.9.md +++ b/etc/NEWS.9.md @@ -8,6 +8,7 @@ Summary of bugs fixed for version 9.4.0 (tbd): ### GUI - Update Spanish translation file (bug #66616). +- Update Brazilian Portuguese translation file (bug #66554). ### Build system / Tests - `cellfun`: Add test for function failing to return requested output @@ -16,6 +17,7 @@ Summary of bugs fixed for version 9.4.0 (tbd): (bug #66642). ### Documentation +- Clarify default editor difference between CLI and GUI (bug #66703). Summary of bugs fixed for version 9.3.0 (2024-12-12): diff --git a/etc/RELEASE-CHECKLIST.wiki b/etc/RELEASE-CHECKLIST.wiki new file mode 100644 index 0000000000..725ae778f0 --- /dev/null +++ b/etc/RELEASE-CHECKLIST.wiki @@ -0,0 +1,155 @@ += VERSION.1 Release Checklist = + +{{Note|'''Timeline''' (tentative) + +* YYYY-MM-DD 🚀 Release Kick-off ⚽ (default branch merged to stable) +* YYYY-MM-DD 🛠️ 1st release candidate '''VERSION.0.90''' on https://alpha.gnu.org/gnu/octave/ +* YYYY-MM-DD 🏁 Final Release 🎉 '''VERSION.1.0''' on https://ftp.gnu.org/gnu/octave/ }} + +Please use <strike> </strike> to mark items below as done. + +== 🚀 Kick-off ⚽ == + +=== ⚙️ Update stable and default branch to new version numbers === + +Completion Date: + +* Merge default onto stable to become the current stable release (see instructions in etc/HACKING.md). +* Bump version numbers in configure.ac on stable branch (see etc/HACKING.md). +* Bump version numbers in configure.ac on default branch (see etc/HACKING.md). +* Create new etc/NEWS.VERSION+1.md file on default branch by copying etc/NEWS.VERSION.md and then removing text so that it is a template file with headings only. + +=== ⚙️ Update gnulib to latest version === + +Completion Date: + +'''Must occur first''' as it could resolve existing, or create new, bug reports. You should run ./bootstrap in the source tree after updating to the new gnulib version. + +=== 📢 Call for bug reports === + +Completion Date: + +* Put out a general call for reports on [https://octave.discourse.group/ Octave Discourse] for all outstanding, but unreported, known bugs. +* Create Savannah Release tag VERSION.0.90 on bug tracker for 1st release candidate. +* Mark items that should be fixed for the release with this tag. +* Update Savannah Planned Release and Fixed Release tags by adding VERSION.1.0 (current stable) and VERSION+1.1.0 (current default). +* Review bug overview at https://octave.space/savannah/. + +=== 📢 Update GUI translation files === + +Completion Date: + +* Call for updates ([https://octave.discourse.group/ Octave Discourse]) that might change GUI strings. +* String freeze date: +* Update language translation files (*.ts). See instructions in libgui/languages/build_ts/README.md. +* Create bug report on Savannah as a centralized location for uploading files and tracking status of translations. +* Call for translations of GUI strings on [https://octave.discourse.group/c/maintainers/7 Octave Discourse Maintainers], CC-ing the translators (see [https://hg.savannah.gnu.org/hgweb/octave/file/tip/libgui/languages/translators list of translators]). +* Collect translation files on Savannah bug report and push to Mercurial. + +=== ⚖️ GPL License activities === + +Completion Date: + + + +=== ✅ Style-check code base === + +Completion Date: + +This will produce lots of whitespace changes, but no behavior changes. '''Must occur after patches have been added''', since whitespace changes can prevent patches from applying. + +* [https://wiki.octave.org/Octave_style_guide m-file style check] +* [https://wiki.octave.org/C%2B%2B_style_guide C++ style check] + +=== 📖 Review documentation === + +Completion Date: + +* Grammar check documentation (See doc/interpreter/doccheck/README). +* Spell check documentation (make spellcheck). +* Verify no functions missing from manual (make doc/interpreter/undocumented_list). +* Verify deprecated functions removed from manual (*.txi) and from “see also” links. +* Verify all formats (Info, HTML, PDF) build correctly. +* Review etc/NEWS.VERSION.md for any features which should be announced. +* Review __unimplemented__.m for the latest changes to [https://wiki.octave.org/Octave_Forge Octave Forge] packages and new Matlab functions. +* Update installer-files/README.html in MXE Octave with version highlights. + +== 🔃 Repeat until all bugs are resolved == + +Completion Date of first iteration: + +=== ⚠️ Current state at Savannah === + +Bug overview at https://octave.space/savannah/. + +=== ✅ make check === + +* Verify make check is passing on all [http://buildbot.octave.org:8010/#/waterfall buildbot combinations of OS and compilers] and [https://github.com/gnu-octave/octave/actions GitHub CI runners]. Also check [https://github.com/gnu-octave/octave-buildbot/actions test suite runs on “freshly brewed Octave for Windows”] (Kai’s buildbots on octave.space). +* Use software tools to check quality of Octave code. +** Check for memory leaks by configuring with --enable-address-sanitizer-flags and compiling with -g -O0 -fno-optimize-sibling-calls in CFLAGS, CXXFLAGS, and LDFLAGS. +** Check for bad memory accesses by compiling with -g -O0 -fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls in CFLAGS, CXXFLAGS, and LDFLAGS. +** Update static code analysis results. +*** For clang, do scan-build make -j<N> all and then scan-view. +*** See [https://wiki.octave.org/PVS_static_analyzer_-_5.0_Release PVS static analyzer - 5.0 Release]. +** Use other tools such as cppcheck, etc. +* Start discussion on [https://octave.discourse.group/c/maintainers/8 Octave Discourse Maintainers] about which failing tests that must be fixed and which can be declared '''WON’T FIX'''. + +=== 🛠️ Create new release candidate === + +* Ensure correct version information (see “Release Numbering” in /etc/HACKING.md). +* Create hg tag in repository with release candidate version number (rc-MAJOR-MINOR-PATCH). +* Verify make dist works. +* Verify make distcheck passes. +* Create [https://wiki.octave.org/Windows_Installer Windows Installer]. +* Upload release candidates to https://alpha.gnu.org/gnu/octave/. +* Check [https://wiki.octave.org/Windows_Installer Windows Installer] (executable and zip formats) against false positive detection at [https://virustotal.com/ virustotal.com]. +* Add release candidate version to Savannah bug tracker. +* Announce release candidate to [https://octave.discourse.group/ Octave Discourse]. + +== 🏁 Final Release 🎉 == + +=== 📃 Update version information === + +Completion Date: + +* Ensure correct version information in configure.ac (see “Release Numbering” in /etc/HACKING.md) +** Set OCTAVE_RELEASE_DATE to the current date. +** Set the year in OCTAVE_COPYRIGHT to the current year. +* Create hg tag in repository with release candidate version number (release-VERSION-1-0). +* Update etc/NEWS.VERSION.md (final release date in Summary header). +* Update CITATION (version, year, URL) if not already done as part of "GPL License activities. +* Update etc/icons/org.octave.Octave.appdata.xml (version number and release date). +* Upload all tarballs to https://ftp.gnu.org/gnu/octave/. +* Update web site files: NEWS-VERSION.html, index.in, news.in, and download.in. +* Update https://wiki.octave.org/Release_History page. +* Update Savannah bug tracker Release field to have new release number. +* Update Savannah bug tracker: '''OPEN''' bugs marked as '''WON’T FIX''' should be marked as '''CONFIRMED''' (or more appropriate) for the final release. +* Hide release candidate versions for Release field on Savannah. + +=== 📢 Announce final release === + +Completion Date: + +* Octave mailing-lists (yes, still) [mailto:help@octave.org help@octave.org] and [mailto:info-gnu@gnu.org info-gnu@gnu.org]. +* Octave web site (https://hg.octave.org/web-octave) +* Steps documented in this [https://hg.octave.org/web-octave/rev/fe59d0118a2b changeset]. +* Upload documentation (manual HTML + PDF octave.org/doc and version in octave.org/.htaccess, Doxygen octave.org/doxygen) +* This wiki +* Template:Release = 7.3.0 +* Template:Release Date = November 2, 2022 +* Template:Release Year = 2022 + +=== ☑️ Post-Release === + +Completion Date: + +* Remove all deprecated functions scheduled for deletion on default branch. These functions are tagged with OCTAVE_DEPRECATED in C++ or are m-files located in the directory scripts/deprecated. Check file etc/NEWS.VERSION-2.md for list of features that have been deprecated. + +[[Category:Releases]] diff --git a/libinterp/corefcn/error.cc b/libinterp/corefcn/error.cc index 1cb8d3099b..55ca8209dc 100644 --- a/libinterp/corefcn/error.cc +++ b/libinterp/corefcn/error.cc @@ -506,7 +506,13 @@ void error_system::vwarning (const char *name, const char *id, const char *fmt, va_list args) { - flush_stdout (); + int warn_opt = warning_enabled (id); + + if (warn_opt == 2) + { + // Handle this warning as an error. ERROR_1 won't return. + error_1 (id, fmt, args); + } std::string base_msg = format_message (fmt, args); std::string msg_string; @@ -526,13 +532,17 @@ error_system::vwarning (const char *name, const char *id, last_warning_id (id); last_warning_message (base_msg); - if (discard_warning_messages ()) + // If WARN_OPT is 0, then the warning is disabled. But we sill + // still set LAST_WARNING_MESSAGE above. + if (discard_warning_messages () || warn_opt == 0) return; tree_evaluator& tw = m_interpreter.get_evaluator (); bool in_user_code = tw.in_user_code (); + flush_stdout (); + if (! quiet_warning ()) { octave_diary << msg_string; @@ -588,16 +598,12 @@ error_system::error_1 (const char *id, const char *fmt, void error_system::vwarning (const char *id, const char *fmt, va_list args) { - int warn_opt = warning_enabled (id); - - if (warn_opt == 2) - { - // Handle this warning as an error. - - error_1 (id, fmt, args); - } - else if (warn_opt == 1) - vwarning ("warning", id, fmt, args); + // OK, this probably seems strange now, but there is a version of + // vwarning that takes the "name" of the warning as an argument, + // possibly because "usage" was previously handled as a warning? + // For consistent behavior, that function will deal with all the + // ON/OFF/ERROR warning state options. + vwarning ("warning", id, fmt, args); } void diff --git a/libinterp/corefcn/load-save.cc b/libinterp/corefcn/load-save.cc index 7fd7b0e19e..c8b63d82dc 100644 --- a/libinterp/corefcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -1233,11 +1233,13 @@ load_save_system::load (const octave_value_list& args, int nargout) { format = MAT_BINARY; } + // FIXME: Unsupported and silently ignored. Can we just delete this? else if (argv[i] == "-force" || argv[i] == "-f") { // Silently ignore this // warning ("load: -force ignored"); } + // FIXME: Unsupported and ignored. Can we just delete this? else if (argv[i] == "-import" || argv[i] == "-i") { warning ("load: -import ignored"); @@ -1586,51 +1588,26 @@ DEFMETHOD (load, interp, args, nargout, @deftypefnx {} {} load file options @deftypefnx {} {} load file options v1 v2 @dots{} @deftypefnx {} {S =} load ("file", "options", "v1", "v2", @dots{}) -Load the named variables @var{v1}, @var{v2}, @dots{}, from the file -@var{file}. +Load the named variables @var{v1}, @var{v2}, @dots{}, from the file @var{file}. -If no variables are specified then all variables found in the -file will be loaded. As with @code{save}, the list of variables to extract -can be full names or use a pattern syntax. The format of the file is -automatically detected but may be overridden by supplying the appropriate -option. +If no variables are specified then all variables found in the file will be +loaded. Otherwise, full variable names or pattern syntax can be used to +specify the variables to save. The format of the file is automatically +detected but may be overridden by supplying the appropriate option. -If load is invoked using the functional form +The @code{load} command may also be invoked using the functional form @example load ("-option1", @dots{}, "file", "v1", @dots{}) @end example @noindent -then the @var{options}, @var{file}, and variable name arguments -(@var{v1}, @dots{}) must be specified as character strings. - -If a variable that is not marked as global is loaded from a file when a -global symbol with the same name already exists, it is loaded in the -global symbol table. Also, if a variable is marked as global in a file -and a local symbol exists, the local symbol is moved to the global -symbol table and given the value from the file. - -If invoked with a single output argument, Octave returns data instead -of inserting variables in the symbol table. If the data file contains -only numbers (TAB- or space-delimited columns), a matrix of values is -returned. Otherwise, @code{load} returns a structure with members - corresponding to the names of the variables in the file. - -The @code{load} command can read data stored in Octave's text and -binary formats, and @sc{matlab}'s binary format. If compiled with zlib -support, it can also load gzip-compressed files. It will automatically -detect the type of file and do conversion from different floating point -formats (currently only IEEE big and little endian, though other formats -may be added in the future). +where the @var{options}, @var{file}, and variable name arguments (@var{v1}, +@dots{}) must be specified as character strings. Valid options for @code{load} are listed in the following table. @table @code -@item -force -This option is accepted for backward compatibility but is ignored. -Octave now overwrites variables currently in memory with -those of the same name found in the file. @item -ascii Force Octave to assume the file contains columns of numbers in text format @@ -1645,18 +1622,13 @@ Force Octave to assume the file is in Octave's binary format. Force Octave to assume the file is in @sc{hdf5} format. (@sc{hdf5} is a free, portable binary format developed by the National Center for Supercomputing Applications at the University of Illinois.) Note that @code{load} is only -designed to read @sc{hdf5} files that were created by itself with @code{save}, +designed to read @sc{hdf5} files that were created by Octave with @code{save}, and attempts to read other @sc{hdf5} files may fail or produce unpredictable -results. The @code{-hdf5} option also provides a limited ability to read -files created using @sc{matlab}'s @code{-v7.3} option (which saves in @sc{hdf5} -format) although many data types are not yet supported. This format is only +results. The @code{-hdf5} option provides a limited ability to read files +created using @sc{matlab}'s @code{-v7.3} option (which saves in @sc{hdf5} +format) although many data types are not yet supported. This format is only available if Octave was built with a link to the @sc{hdf5} libraries. -@item -import -This option is accepted for backward compatibility but is ignored. -Octave can now support multi-dimensional HDF data and automatically -modifies variable names if they are invalid Octave identifiers. - @item -text Force Octave to assume the file is in Octave's text format. @@ -1689,7 +1661,45 @@ Force Octave to assume the file is in @sc{matlab}'s version 6 binary format. Force Octave to assume the file is in @sc{matlab}'s version 4 binary format. @end table -@seealso{save, dlmwrite, csvwrite, fwrite} + +The list of variables to load may use wildcard patterns (glob patterns) +containing the following special characters: + +@table @code +@item ? +Match any single character. + +@item * +Match zero or more characters. + +@item [ @var{list} ] +Match the list of characters specified by @var{list}. If the first character +is @code{!} or @code{^}, match all characters except those specified by +@var{list}. For example, the pattern @code{[a-zA-Z]} will match all lower and +uppercase alphabetic characters. + +@end table + +If invoked with a single output argument, Octave assigns loaded data to the +output instead of inserting variables in the symbol table. If the data file +contains only numbers (TAB- or space-delimited columns), a matrix of values is +returned. Otherwise, @code{load} returns a structure with members +corresponding to the names of the variables in the file. + +The @code{load} command can read data stored in Octave's text and binary +formats, @sc{matlab}'s binary format, and many simple formats such as +comma-separated-values (CSV). If compiled with zlib support, it can also load +gzip-compressed files. It will automatically detect the type of file and do +conversion from different floating point formats (currently only IEEE big and +little endian, though other formats may be added in the future). + +Programming Note: If a variable that is not marked as global is loaded from a +file when a global symbol with the same name already exists, it is loaded in +the global symbol table. Also, if a variable is marked as global in a file and +a local symbol exists, the local symbol is moved to the global symbol table and +given the value from the file. + +@seealso{save, csvread, dlmread, fread, textscan} @end deftypefn */) { load_save_system& load_save_sys = interp.get_load_save_system (); @@ -1708,35 +1718,31 @@ DEFMETHOD (save, interp, args, nargout, @deftypefnx {} {@var{str} =} save ("-", @qcode{"@var{v1}"}, @qcode{"@var{v2}"}, @dots{}) Save the named variables @var{v1}, @var{v2}, @dots{}, in the file @var{file}. -The special filename @samp{-} may be used to return the content of the -variables as a string. If no variable names are listed, Octave saves all the -variables in the current scope. Otherwise, full variable names or pattern -syntax can be used to specify the variables to save. If the @option{-struct} -modifier is used then the fields of the @strong{scalar} struct are saved as if -they were variables with the corresponding field names. The @option{-struct} -option can be combined with specific field names @var{f1}, @var{f2}, @dots{} to -write only certain fields to the file. - -Valid options for the @code{save} command are listed in the following table. -Options that modify the output format override the format specified by -@code{save_default_options}. +If no variable names are listed, Octave saves all the variables in the current +scope. Otherwise, full variable names or pattern syntax can be used to specify +the variables to save. If the @option{-struct} modifier is used then the +fields of the @strong{scalar} struct are saved as if they were variables with +the corresponding field names. The @option{-struct} option can be combined +with specific field names @var{f1}, @var{f2}, @dots{} to write only certain +fields to the file. -If save is invoked using the functional form +The @code{save} command may also be invoked using the functional form @example save ("-option1", @dots{}, "file", "v1", @dots{}) @end example @noindent -then the @var{options}, @var{file}, and variable name arguments (@var{v1}, +where the @var{options}, @var{file}, and variable name arguments (@var{v1}, @dots{}) must be specified as character strings. -If called with a filename of @qcode{"-"}, write the output to stdout if nargout -is 0, otherwise return the output in a character string. +Valid options for the @code{save} command are listed in the following table. +Options that modify the output format override the format specified by +@code{save_default_options}. @table @code @item -append -Append to the destination instead of overwriting. +Append to the file instead of overwriting. @item -ascii Save a matrix in a text file without a header or any other information. The @@ -1756,23 +1762,27 @@ Separate numbers with tabs. Save the data in Octave's binary data format. @item -float-binary -Save the data in Octave's binary data format but using only single precision. +Save the data in Octave's binary data format using just single precision. Use this format @strong{only} if you know that all the values to be saved can be represented in single precision. @item -hdf5 -Save the data in @sc{hdf5} format. (HDF5 is a free, portable, binary format -developed by the National Center for Supercomputing Applications at the -University of Illinois.) This format is only available if Octave was built +Save the data in @sc{hdf5} format. (@sc{hdf5} is a free, portable, binary +format developed by the National Center for Supercomputing Applications at the +University of Illinois.) This format is only available if Octave was built with a link to the @sc{hdf5} libraries. @item -float-hdf5 -Save the data in @sc{hdf5} format but using only single precision. Use this +Save the data in @sc{hdf5} format using just single precision. Use this format @strong{only} if you know that all the values to be saved can be represented in single precision. -@item -text -Save the data in Octave's text data format. (default) +@item -text (default) +Save the data in Octave's text data format. The +@ref{XREFsave_precision,,@code{save_precision}} function specifies the number +of significant figures to use when saving data (default: 17). The header of +the text data file can be configure with +@ref{XREFsave_header_format_string,,@code{save_header_format_string}}. @item -v7.3 @itemx -V7.3 @@ -1828,10 +1838,13 @@ Wildcards may also be used in the field name specifications when using the @end table -Except when using the @sc{matlab} binary data file format or the @samp{-ascii} -format, saving global variables also saves the global status of the variable. -If the variable is restored at a later time using @samp{load}, it will be -restored as a global variable. +Programming Notes: If called with the special filename @qcode{"-"} the data to +be saved is returned as a string rather than writing it to an actual file. + +When saving global variables the global status of the variable is also stored. +If the variable is restored at a later time using @code{load}, it will be +restored as a global variable. Global status is @emph{not} preserved if +using a @sc{matlab} binary data file format or the @option{-ascii} format. Example: @@ -1844,8 +1857,9 @@ save -binary data a b* @noindent saves the variable @samp{a} and all variables beginning with @samp{b} to the file @file{data} in Octave's binary format. + @seealso{load, save_default_options, save_header_format_string, save_precision, -dlmread, csvread, fread} +csvwrite, dlmwrite, fwrite} @end deftypefn */) { load_save_system& load_save_sys = interp.get_load_save_system (); diff --git a/libinterp/corefcn/pow2.cc b/libinterp/corefcn/pow2.cc index 990e0a913b..7c2ee46010 100644 --- a/libinterp/corefcn/pow2.cc +++ b/libinterp/corefcn/pow2.cc @@ -316,8 +316,10 @@ to C/C++ standard function @code{ldexp()}. %!error pow2 (1,2,3) %!error pow2 (int8 (1)) %!error pow2 (2, int8 (1)) -%!warning pow2 (i, 2); -%!warning pow2 (2, i); +%!test +%! warning ('error', 'Octave:pow2:imaginary-ignored'); +%! fail ('pow2 (i, 2)', 'imaginary part is ignored'); +%! fail ('pow2 (2, i)', 'imaginary part is ignored'); %!error pow2 ([1,2], [3,4,5]) %!error pow2 (sparse ([1,2]), sparse ([3,4,5])) */ diff --git a/libinterp/parse-tree/pt-mat.cc b/libinterp/parse-tree/pt-mat.cc index d521c3ae7a..635aa3b6f4 100644 --- a/libinterp/parse-tree/pt-mat.cc +++ b/libinterp/parse-tree/pt-mat.cc @@ -135,7 +135,7 @@ maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p) { if (! (all_dq_strings_p || all_sq_strings_p)) warning_with_id ("Octave:mixed-string-concat", - "concatenation of different character string types may have unintended consequences"); + "concatenation of single and double quoted string objects creates a single quoted string object"); } tree_expression * diff --git a/scripts/general/num2str.m b/scripts/general/num2str.m index 14045181df..0d257f370f 100644 --- a/scripts/general/num2str.m +++ b/scripts/general/num2str.m @@ -134,6 +134,8 @@ fmt = "%3d"; endif endif + ## FIXME: Remove when Matlab strings are implemented in Octave. + warning ('off', 'Octave:mixed-string-concat', 'local'); fmt = do_string_escapes (fmt); # required now that '\n' is interpreted. nd = ndims (x); nc = columns (x) * (nd - 1); # ND-arrays are expanded in columns diff --git a/scripts/help/warning_ids.m b/scripts/help/warning_ids.m index 120c9a562a..c3d75b9d8e 100644 --- a/scripts/help/warning_ids.m +++ b/scripts/help/warning_ids.m @@ -305,7 +305,7 @@ ## ## @item Octave:mixed-string-concat ## If the @code{Octave:mixed-string-concat} warning is enabled, print a -## warning when concatenating a mixture of double and single quoted strings. +## warning when concatenating a mixture of single and double quoted strings. ## By default, the @code{Octave:mixed-string-concat} warning is disabled. ## ## @item Octave:nearly-singular-matrix diff --git a/scripts/image/imshow.m b/scripts/image/imshow.m index 8b84966eb1..c68f067862 100644 --- a/scripts/image/imshow.m +++ b/scripts/image/imshow.m @@ -283,9 +283,11 @@ %! fail ('imshow ([1,1], "parent", -1)', "must be an axes handle"); %! fail ('imshow ([1,1], "xdata", ones (2,2))', "xdata must be a vector"); %! fail ('imshow ([1,1], "ydata", ones (2,2))', "ydata must be a vector"); -%! fail ('imshow ([1,1], "foobar")', "warning", "unrecognized property foobar"); +%! ## Not possible to test with current warning architecture +%! #fail ('imshow ([1,1], "foobar")', "warning", "unrecognized property foobar"); %! fail ("imshow ([1,1], {1})", "argument number 2 is invalid"); -%! fail ("imshow ([1+i,1-i])", "warning", "only showing real part of complex image"); +%! ## Not possible to test with current warning architecture +%! #fail ("imshow ([1+i,1-i])", "warning", "only showing real part of complex image"); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect diff --git a/scripts/plot/appearance/annotation.m b/scripts/plot/appearance/annotation.m index 26b43726e7..c29d952d28 100644 --- a/scripts/plot/appearance/annotation.m +++ b/scripts/plot/appearance/annotation.m @@ -1589,7 +1589,8 @@ function update_rect (h, ~, prop, hre, typ) %!error annotation ("textbox", ones (4,4)) %!error annotation ("textbox", 1:3) %!error annotation ("foo") -%!warning +## Not possible to test with current warning architecture +%!#warning %! hf = figure ("visible", "off"); %! unwind_protect %! annotation ("line", 1:2, 1:2, "color"); diff --git a/scripts/statistics/var.m b/scripts/statistics/var.m index cde793acb0..3a68d766d6 100644 --- a/scripts/statistics/var.m +++ b/scripts/statistics/var.m @@ -203,7 +203,7 @@ m = x; return; endif - if (vecdim_scalar_vector == [0 1] && (! all (diff (sort (vecdim))))) + if (all (vecdim_scalar_vector == [0 1]) && (! all (diff (sort (vecdim))))) error ("var: VECDIM must contain non-repeating positive integers"); endif endif diff --git a/scripts/strings/erase.m b/scripts/strings/erase.m index 89f271d1a8..e03e7c189a 100644 --- a/scripts/strings/erase.m +++ b/scripts/strings/erase.m @@ -104,7 +104,7 @@ else ptn = regexptranslate ("escape", ptn(:).'); ptn = strjoin (ptn, '|'); - newstr = regexprep (str, ptn, ""); + newstr = regexprep (str, ptn, ''); endif if (ischarmatrix) @@ -149,4 +149,4 @@ %!error erase ([1], "foo") %!error erase ("foo", [1]) %!warning -%! erase ("a", ["a";"b"]); +%! erase ('a', ['a';'b']); diff --git a/scripts/strings/strjoin.m b/scripts/strings/strjoin.m index a6dd3af4c0..cfb3789e10 100644 --- a/scripts/strings/strjoin.m +++ b/scripts/strings/strjoin.m @@ -70,16 +70,16 @@ num = numel (cstr); if (numel (delimiter) == 1 && num > 1) delimiter = repmat (delimiter, 1, num); - delimiter(end) = {""}; + delimiter(end) = {''}; elseif (num > 0 && numel (delimiter) != num - 1) error ("Octave:strjoin:cellstring_delimiter_mismatch", "strjoin: the number of delimiters does not match the number of strings"); else - delimiter(end+1) = {""}; + delimiter(end+1) = {''}; endif if (num == 0) - rval = ""; + rval = ''; else rval = [[cstr(:).'; delimiter(:).']{:}]; endif diff --git a/test/parser.tst b/test/parser.tst index 9be0368fa4..4ea09527fb 100644 --- a/test/parser.tst +++ b/test/parser.tst @@ -362,6 +362,7 @@ %! assert (x == 0); %!test <*56959> -%! fail ("i:5", "warning", "imaginary part of complex colon arguments is ignored"); -%! fail ("1:5*i", "warning", "imaginary part of complex colon arguments is ignored"); -%! fail ("1:i:5", "warning", "imaginary part of complex colon arguments is ignored"); +%! warning ('error', 'Octave:colon-complex-argument'); +%! fail ("i:5", "imaginary part of complex colon arguments is ignored"); +%! fail ("1:5*i", "imaginary part of complex colon arguments is ignored"); +%! fail ("1:i:5", "imaginary part of complex colon arguments is ignored");