bugGNU Octave - Bugs: bug #55935, Useless...


bug #55935: Useless "new_sid->m_name;" in octave::symbol_scope_rep::dup

Submitted by:  Andrew Janke <apjanke>
Submitted on:  Sat 16 Mar 2019 01:31:31 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Tue 19 Mar 2019 04:29:19 PM UTC, comment #2: 

For now, I pushed this change to remove the useless statemnet:


Closing as fixed.

John W. Eaton <jwe>
Project Administrator
Sat 16 Mar 2019 01:44:17 PM UTC, comment #1: 

My aim is to remove these dup methods, or at least remove the need for the symbol_scope parameter.  My recent changes to support handles to nested functions is a step in that direction but I'm not sure we are quite to the point where it can be removed.  I'll check out this specific issue though, hopefully later today.  Thanks.

John W. Eaton <jwe>
Project Administrator
Sat 16 Mar 2019 01:31:31 PM UTC, original submission:  

In libinterp/corefcn/symscope.h at line 120:

    std::shared_ptr<symbol_scope_rep> dup (void) const
      std::shared_ptr<symbol_scope_rep> new_sid
        = std::shared_ptr<symbol_scope_rep> (new symbol_scope_rep (m_name));


That "new_sid->m_name;" statement is a no-op, I think. Should it actually be initialized from this's m_name? Or some other source?

Causes a warning in clang:

In file included from ../../octave/libinterp/corefcn/errwarn.cc:27:
In file included from ../../octave/libinterp/corefcn/defun.h:32:
In file included from ../../octave/libinterp/corefcn/defun-int.h:30:
In file included from ../../octave/libinterp/octave-value/ov-builtin.h:32:
In file included from ../../octave/libinterp/octave-value/ov-fcn.h:36:
../../octave/libinterp/corefcn/symscope.h:120:16: warning: expression result unused [-Wunused-value]
      ~~~~~~~  ^~~~~~

Andrew Janke <apjanke>


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

Attach Files:

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 apjanke (Submitted the item)

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

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-19 jwe StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5