bugGNU Octave - Bugs: bug #64787, The argument validation warning...

 
 

bug #64787: The argument validation warning does not have an associated ID

Submitter:  None
Submitted:  Wed 18 Oct 2023 09:26:32 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Missed Error or Warning
Status:  None Assigned to:  None
Originator Name:  Jeppe Klitgaard Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 8.3.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 19 Oct 2023 12:03:03 PM UTC, comment #4: 

I would prefer the warning (and one that can be disabled as well), as it enables greater interoperability with MATLAB. I currently need to be able to run the same source code on MATLAB and Octave and would have to remove the arguments blocks to achieve this if an error was unconditionally raised.

I agree that there is a good reason for the warning and it should not be disabled unless the user is willing to face that risk. I would argue having to disable it is enough of a consent check though.

Anonymous
Thu 19 Oct 2023 09:58:30 AM UTC, comment #3: 

I don't think it's a good idea to allow the arguments block warning to be disabled.  Like the warning says, incorrect results are possible if execution of arguments blocks are simply skipped.  It seems bad to me to allow that without a warning.

I suppose another option is to just disable the parsing of arguments blocks until they are completely implemented so you get an unconditional error instead of an unconditional warning.

John W. Eaton <jwe>
Group administrator
Thu 19 Oct 2023 09:49:53 AM UTC, comment #2: 

This is exactly what I needed. Thank you so much for the swift handling!

Anonymous
Wed 18 Oct 2023 09:29:15 PM UTC, comment #1: 

There were a couple other warnings in the same file without ids, so for good measure I changed all of them as follows. Does this change work for you?


diff -r fd5ae4140483 libinterp/parse-tree/pt-eval.cc
--- a/libinterp/parse-tree/pt-eval.cc   Wed Oct 18 17:04:46 2023 -0400
+++ b/libinterp/parse-tree/pt-eval.cc   Wed Oct 18 17:26:47 2023 -0400
@@ -1257,7 +1257,8 @@ tree_evaluator::visit_argument_list (tre
 void
 tree_evaluator::visit_arguments_block (tree_arguments_block&)
 {
-  warning ("function arguments validation blocks are not supported; INCORRECT RESULTS ARE POSSIBLE");
+  warning_with_id ("Octave:function-arg-blocks-unsupported",
+  "function arguments validation blocks are not supported; INCORRECT RESULTS ARE POSSIBLE");
 }

 void
@@ -2702,7 +2703,8 @@ void tree_evaluator::mlock (bool skip_fi

   if (fcn->is_builtin_function ())
     {
-      warning ("mlock: locking built-in function has no effect");
+      warning_with_id ("Octave:lock-built-in-no-effect",
+                       "mlock: locking built-in function has no effect");
       return;
     }

@@ -2718,7 +2720,8 @@ void tree_evaluator::munlock (bool skip_

   if (fcn->is_builtin_function ())
     {
-      warning ("munlock: unlocking built-in function has no effect");
+      warning_with_id ("Octave:unlock-built-in-no-effect",
+                       "munlock: unlocking built-in function has no effect");
       return;
     }


Arun Giridhar <arungiridhar>
Group Member
Wed 18 Oct 2023 09:26:32 AM UTC, original submission:  

I want to be able to suppress the warnings of with template "function arguments validation blocks are not supported; INCORRECT RESULTS ARE POSSIBLE" that arise when the interpreter reaches MATLAB argument validation blocks.

Unfortunately, this warning is issued without an ID and can therefore not be disabled.

The relevant code seems to be
```
  tree_evaluator::visit_arguments_block (tree_arguments_block&)
  {
    warning ("function arguments validation blocks are not supported; INCORRECT RESULTS ARE POSSIBLE");
  }
```
in pt-eval.cc

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-19 jwe Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code