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

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

[Octave-bug-tracker] [bug #43249] Wrong line number in error message


From: Falk Tannhäuser
Subject: [Octave-bug-tracker] [bug #43249] Wrong line number in error message
Date: Thu, 18 Sep 2014 13:55:43 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0

URL:
  <http://savannah.gnu.org/bugs/?43249>

                 Summary: Wrong line number in error message
                 Project: GNU Octave
            Submitted by: fata
            Submitted on: Do 18 Sep 2014 15:55:42 CEST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: fata
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

The following function, contained in the Octave file error_test.m, has an
error in line 9 (trying to compare element-wise two character arrays of
different length) which is detected by Octave during execution:


function error_test(boolflag = false)
  do
    if boolflag
      printf("true\n");   # Line 4
    else
      printf("false\n");  # Line 6
    endif
  until "abc" == "de"     # Line 9
endfunction


However, the line number given in the error message is wrong:


octave:1> error_test(false)
false
error: error_test: mx_el_eq: nonconformant arguments (op1 is 1x3, op2 is 1x2)
error: called from:
error:   /cygdrive/c/Users/tannhauser/Documents/error_test.m at line 6, column
7
octave:1> error_test(true)
true
error: error_test: mx_el_eq: nonconformant arguments (op1 is 1x3, op2 is 1x2)
error: called from:
error:   /cygdrive/c/Users/tannhauser/Documents/error_test.m at line 4, column
7


This makes it difficult to identify and to fix this kind of error, in
particular if functions are larger.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Do 18 Sep 2014 15:55:42 CEST  Name: error_test.m  Size: 204B   By: fata

<http://savannah.gnu.org/bugs/download.php?file_id=32132>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43249>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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