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

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

[Octave-bug-tracker] [bug #66647] num2str gives an unexpected warning ab


From: anonymous
Subject: [Octave-bug-tracker] [bug #66647] num2str gives an unexpected warning about concatenation
Date: Thu, 9 Jan 2025 09:07:05 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?66647>

                 Summary: num2str gives an unexpected warning about
concatenation
                   Group: GNU Octave
               Submitter: None
               Submitted: Thu 09 Jan 2025 02:07:01 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: Roger
        Originator Email: rogerdingen@gmail.com
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 8.4.0
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 09 Jan 2025 02:07:01 PM UTC By: Anonymous
The command:

num2str(2)

gives the warning:

warning: concatenation of different character string types may have unintended
consequences
warning: called from
    num2str at line 143 column 11

ans = 2

I don't expect this warning, as there does not seem to be any concatenation
taking place. The output, a character string "2" is correct though.

I tried different inputs. Curiously, mat2str([2]) does not give a warning,
just the string "2".

While diagnosing the issue, I noticed that 

plot(1:10)

also gives an unexpected warning, which also involves unexpected string
conversion:

warning: implicit conversion from string to real matrix
warning: called from
    __pltopt__>decode_linespec at line 161 column 9
    __pltopt__ at line 116 column 27
    __next_line_style__ at line 58 column 11
    __plt__>__plt2vv__ at line 495 column 25
    __plt__>__plt2__ at line 248 column 14
    __plt__>__plt1__ at line 207 column 10
    __plt__ at line 121 column 16
    plot at line 235 column 10


I installed octave from the repository (8.4.0-1build5, Ubuntu 24.04.1 LTS).







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66647>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

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