bugGNU Octave - Bugs: bug #40368, octave_config_info() should be...

 
 

bug #40368: octave_config_info() should be read-only

Submitted by:  Rik <rik5>
Submitted on:  Fri 25 Oct 2013 02:52:29 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 25 Oct 2013 08:21:36 PM UTC, comment #6:

It seems like this is the way The Mathworks wants us to behave, so I'm marking this bug as "Won't Fix" and closing it.

Rik <rik5>
Project Administrator
Fri 25 Oct 2013 03:55:49 PM UTC, comment #5:

I agree that overriding an existing variable should be allowed to happen, but the indexing with a string seems easy enough to catch. I'll ask on the maintainer's list for someone to confirm Matlab behavior on this one.

Rik <rik5>
Project Administrator
Fri 25 Oct 2013 03:19:05 PM UTC, comment #4:

A warning about creating a variable with the same name as an existing function is probably not workable. For efficiency, we'd probably want to do the check in the parser, not the evaluator, but the list of visible functions might not be the same when a statement is parsed vs. executed.

We do currently have a warning for the implicit conversion of the character array index to a numerical value, but it is disabled by default for improved Matlab compatibility. I don't remember whether that default was chosen because of a complaint about compatibility, or if it was just something we did so that Octave's behavior would match Matlab.

I suppose it would be possible to warn about indexing with a character variable in addition to the warning about converting the index to a number. I don't know whether that would generate complaints about unwanted warnings from Matlab users.

John W. Eaton <jwe>
Project Administrator
Fri 25 Oct 2013 03:06:42 PM UTC, comment #3:

Is there a way Octave could produce a warning message in this situation? Trying to index into a non-existent variable with a string doesn't seem like something that the user intended.

More samples

The assignment succeeds when the index expression on the left matches the size of the expression on the right. And if you do an alphabetical sort on "junk" the ordering is [1 4 3 2] so it appears that it is doing a = "abcd"([1 4 3 2]).

Rik <rik5>
Project Administrator
Fri 25 Oct 2013 04:45:20 AM UTC, comment #2:

Hmm, I think this is not actually changing the value of the configuration variables. But it is creating a new character variable with the name 'octave_config_info' that is mostly zeros. After doing the assignment, look at the value of "toascii (octave_config_info)" and then do "clear octave_config_info" and then octave_config_info should again give you the configuration values.

So I think I'm going to have to close this one as invalid...

John W. Eaton <jwe>
Project Administrator
Fri 25 Oct 2013 04:26:45 AM UTC, comment #1:

Yeah, that should definitely not be happening because octave_config_info is a function that is just supposed to be returning a value.

It's weird that it also only seems to work for some RHS string lengths and not others.

John W. Eaton <jwe>
Project Administrator
Fri 25 Oct 2013 02:52:29 AM UTC, original submission:

The configuration information should be read-only (since you can't change configuration like which compiler you used at run-time). However, the function octave_config_info supports assignment and it produces strange results.

Rik <rik5>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 25 Oct 2013 08:21:36 PM UTCrik5Item GroupOther=>Matlab Compatibility
      StatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1